diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2024-09-01 19:59:59 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2024-09-01 19:59:59 -0700 |
commit | 67784a74e258a467225f0e68335df77acd67b7ab (patch) | |
tree | 43cc0f1a545d6f0d13a9e9872aaf20ab01cd6ef7 | |
parent | c9f016e72b5cc7d4d68fac51f8e72c8c7a69c06e (diff) | |
parent | 284b75a3d83c7631586d98f6dede1d90f128f0db (diff) |
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); |