diff options
author | 2024-09-01 19:59:59 -0700 | |
---|---|---|
committer | 2024-09-01 19:59:59 -0700 | |
commit | 67784a74e258a467225f0e68335df77acd67b7ab (patch) | |
tree | 43cc0f1a545d6f0d13a9e9872aaf20ab01cd6ef7 | |
parent | Merge tag 'x86-urgent-2024-09-01' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip (diff) | |
parent | ata: libata: Fix memory leak for error path in ata_host_alloc() (diff) | |
download | linux-rng-67784a74e258a467225f0e68335df77acd67b7ab.tar.xz linux-rng-67784a74e258a467225f0e68335df77acd67b7ab.zip |
Merge tag 'ata-6.11-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/libata/linux
Pull ata fix from Damien Le Moal:
- Fix a potential memory leak in the ata host initialization code (from
Zheng)
* tag 'ata-6.11-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/libata/linux:
ata: libata: Fix memory leak for error path in ata_host_alloc()
-rw-r--r-- | drivers/ata/libata-core.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index c7752dc80028..30932552437a 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c @@ -5593,8 +5593,10 @@ struct ata_host *ata_host_alloc(struct device *dev, int n_ports) } dr = devres_alloc(ata_devres_release, 0, GFP_KERNEL); - if (!dr) + if (!dr) { + kfree(host); goto err_out; + } devres_add(dev, dr); dev_set_drvdata(dev, host); |