Skip to content

Commit 430f780

Browse files
jhovoldvinodkoul
authored andcommitted
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: d702419 ("dmaengine: ti: k3-udma: Add glue layer for non DMAengine users") Fixes: 1438cde ("dmaengine: ti: k3-udma: add missing put_device() call in of_xudma_dev_get()") Cc: stable@vger.kernel.org # 5.6: 1438cde Cc: Grygorii Strashko <grygorii.strashko@ti.com> Cc: Yu Kuai <yukuai3@huawei.com> Signed-off-by: Johan Hovold <johan@kernel.org> Link: https://patch.msgid.link/20251117161258.10679-17-johan@kernel.org Signed-off-by: Vinod Koul <vkoul@kernel.org>
1 parent 646ff78 commit 430f780

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/dma/ti/k3-udma-private.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ struct udma_dev *of_xudma_dev_get(struct device_node *np, const char *property)
4242
}
4343

4444
ud = platform_get_drvdata(pdev);
45+
put_device(&pdev->dev);
4546
if (!ud) {
4647
pr_debug("UDMA has not been probed\n");
47-
put_device(&pdev->dev);
4848
return ERR_PTR(-EPROBE_DEFER);
4949
}
5050

0 commit comments

Comments
 (0)