Revert "ata: libata: Fix memory leak for error path in ata_host_alloc()"

This reverts commit f51ad3cb56.
This commit is contained in:
Ksawlii 2024-11-24 00:23:46 +01:00
parent 1061ec7626
commit 7dc3729a31

View file

@ -5429,10 +5429,8 @@ struct ata_host *ata_host_alloc(struct device *dev, int max_ports)
}
dr = devres_alloc(ata_devres_release, 0, GFP_KERNEL);
if (!dr) {
kfree(host);
if (!dr)
goto err_out;
}
devres_add(dev, dr);
dev_set_drvdata(dev, host);