Commit 430f7803 authored by Johan Hovold's avatar Johan Hovold Committed by Vinod Koul
Browse files

dmaengine: ti: k3-udma: fix device leak on udma lookup



Make sure to drop the reference taken when looking up the UDMA platform
device.

Note that holding a reference to a platform device does not prevent its
driver data from going away so there is no point in keeping the
reference after the lookup helper returns.

Fixes: d7024191 ("dmaengine: ti: k3-udma: Add glue layer for non DMAengine users")
Fixes: 1438cde8 ("dmaengine: ti: k3-udma: add missing put_device() call in of_xudma_dev_get()")
Cc: stable@vger.kernel.org	# 5.6: 1438cde8
Cc: Grygorii Strashko <grygorii.strashko@ti.com>
Cc: Yu Kuai <yukuai3@huawei.com>
Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
Link: https://patch.msgid.link/20251117161258.10679-17-johan@kernel.org


Signed-off-by: default avatarVinod Koul <vkoul@kernel.org>
parent 646ff780
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -42,9 +42,9 @@ struct udma_dev *of_xudma_dev_get(struct device_node *np, const char *property)
	}

	ud = platform_get_drvdata(pdev);
	put_device(&pdev->dev);
	if (!ud) {
		pr_debug("UDMA has not been probed\n");
		put_device(&pdev->dev);
		return ERR_PTR(-EPROBE_DEFER);
	}