Unverified Commit 2468ae4f authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!11548 ata: libata: Fix memory leak for error path in ata_host_alloc()

parents 83751e76 53fd6039
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -5426,8 +5426,10 @@ struct ata_host *ata_host_alloc(struct device *dev, int max_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);