Skip to content

Commit 67784a7

Browse files
committed
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()
2 parents c9f016e + 284b75a commit 67784a7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/ata/libata-core.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5593,8 +5593,10 @@ struct ata_host *ata_host_alloc(struct device *dev, int n_ports)
55935593
}
55945594

55955595
dr = devres_alloc(ata_devres_release, 0, GFP_KERNEL);
5596-
if (!dr)
5596+
if (!dr) {
5597+
kfree(host);
55975598
goto err_out;
5599+
}
55985600

55995601
devres_add(dev, dr);
56005602
dev_set_drvdata(dev, host);

0 commit comments

Comments
 (0)