Skip to content

Commit 1438cde

Browse files
YuKuai-huaweivinodkoul
authored andcommitted
dmaengine: ti: k3-udma: add missing put_device() call in of_xudma_dev_get()
if of_find_device_by_node() succeed and platform_get_drvdata() failed, of_xudma_dev_get() will return without put_device(), which will leak the memory. Signed-off-by: Yu Kuai <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent 466257d commit 1438cde

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ struct udma_dev *of_xudma_dev_get(struct device_node *np, const char *property)
4242
ud = platform_get_drvdata(pdev);
4343
if (!ud) {
4444
pr_debug("UDMA has not been probed\n");
45+
put_device(&pdev->dev);
4546
return ERR_PTR(-EPROBE_DEFER);
4647
}
4748

0 commit comments

Comments
 (0)