Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: d70241913413 ("dmaengine: ti: k3-udma: Add glue layer for non DMAengine users")
Fixes: 1438cde8fe9c ("dmaengine: ti: k3-udma: add missing put_device() call in of_xudma_dev_get()")
Cc: stable@vger.kernel.org # 5.6: 1438cde8fe9c
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>

authored by

Johan Hovold and committed by
Vinod Koul
430f7803 646ff780

+1 -1
+1 -1
drivers/dma/ti/k3-udma-private.c
··· 42 42 } 43 43 44 44 ud = platform_get_drvdata(pdev); 45 + put_device(&pdev->dev); 45 46 if (!ud) { 46 47 pr_debug("UDMA has not been probed\n"); 47 - put_device(&pdev->dev); 48 48 return ERR_PTR(-EPROBE_DEFER); 49 49 } 50 50