projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
466257d
)
dmaengine: ti: k3-udma: add missing put_device() call in of_xudma_dev_get()
author
Yu Kuai
<yukuai3@huawei.com>
Thu, 18 Jun 2020 13:01:10 +0000
(21:01 +0800)
committer
Vinod Koul
<vkoul@kernel.org>
Wed, 24 Jun 2020 06:06:10 +0000
(11:36 +0530)
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 <yukuai3@huawei.com>
Link:
https://lore.kernel.org/r/20200618130110.582543-1-yukuai3@huawei.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/dma/ti/k3-udma-private.c
patch
|
blob
|
history
diff --git
a/drivers/dma/ti/k3-udma-private.c
b/drivers/dma/ti/k3-udma-private.c
index 0b8f3dd6b146313c42e87c9d434ff04da8c8614b..77e8e67d995b3bd2eb4afe02a74e3e6842fdd4dd 100644
(file)
--- a/
drivers/dma/ti/k3-udma-private.c
+++ b/
drivers/dma/ti/k3-udma-private.c
@@
-42,6
+42,7
@@
struct udma_dev *of_xudma_dev_get(struct device_node *np, const char *property)
ud = platform_get_drvdata(pdev);
if (!ud) {
pr_debug("UDMA has not been probed\n");
+ put_device(&pdev->dev);
return ERR_PTR(-EPROBE_DEFER);
}