提交 9226dd51 编写于 作者: L Liu Shixin 提交者: sanglipeng

dmaengine: xilinx_dma: call of_node_put() when breaking out of for_each_child_of_node()

stable inclusion
from stable-v5.10.166
commit 98519ed6911357cafd8572e6945c5e1240bea73f
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I7TH9O

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=98519ed6911357cafd8572e6945c5e1240bea73f

--------------------------------

[ Upstream commit 596b53cc ]

Since for_each_child_of_node() will increase the refcount of node, we need
to call of_node_put() manually when breaking out of the iteration.

Fixes: 9cd4360d ("dma: Add Xilinx AXI Video Direct Memory Access Engine driver support")
Signed-off-by: NLiu Shixin <liushixin2@huawei.com>
Acked-by: NPeter Korsgaard <peter@korsgaard.com>
Link: https://lore.kernel.org/r/20221122021612.1908866-1-liushixin2@huawei.comSigned-off-by: NVinod Koul <vkoul@kernel.org>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: Nsanglipeng <sanglipeng1@jd.com>
上级 88709ff3
...@@ -3119,8 +3119,10 @@ static int xilinx_dma_probe(struct platform_device *pdev) ...@@ -3119,8 +3119,10 @@ static int xilinx_dma_probe(struct platform_device *pdev)
/* Initialize the channels */ /* Initialize the channels */
for_each_child_of_node(node, child) { for_each_child_of_node(node, child) {
err = xilinx_dma_child_probe(xdev, child); err = xilinx_dma_child_probe(xdev, child);
if (err < 0) if (err < 0) {
of_node_put(child);
goto error; goto error;
}
} }
if (xdev->dma_config->dmatype == XDMA_TYPE_VDMA) { if (xdev->dma_config->dmatype == XDMA_TYPE_VDMA) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册