* [PATCH] dmaengine: xilinx_dma: call of_node_put() when breaking out of for_each_child_of_node()
@ 2022-11-22 2:16 Liu Shixin
2022-11-22 6:59 ` Peter Korsgaard
0 siblings, 1 reply; 2+ messages in thread
From: Liu Shixin @ 2022-11-22 2:16 UTC (permalink / raw)
To: Vinod Koul, Michal Simek
Cc: dmaengine, linux-arm-kernel, linux-kernel, Liu Shixin
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: 9cd4360de609 ("dma: Add Xilinx AXI Video Direct Memory Access Engine driver support")
Signed-off-by: Liu Shixin <liushixin2@huawei.com>
---
drivers/dma/xilinx/xilinx_dma.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/dma/xilinx/xilinx_dma.c b/drivers/dma/xilinx/xilinx_dma.c
index 8cd4e69dc7b4..766017570488 100644
--- a/drivers/dma/xilinx/xilinx_dma.c
+++ b/drivers/dma/xilinx/xilinx_dma.c
@@ -3141,8 +3141,10 @@ static int xilinx_dma_probe(struct platform_device *pdev)
/* Initialize the channels */
for_each_child_of_node(node, child) {
err = xilinx_dma_child_probe(xdev, child);
- if (err < 0)
+ if (err < 0) {
+ of_node_put(child);
goto error;
+ }
}
if (xdev->dma_config->dmatype == XDMA_TYPE_VDMA) {
--
2.25.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] dmaengine: xilinx_dma: call of_node_put() when breaking out of for_each_child_of_node()
2022-11-22 2:16 [PATCH] dmaengine: xilinx_dma: call of_node_put() when breaking out of for_each_child_of_node() Liu Shixin
@ 2022-11-22 6:59 ` Peter Korsgaard
0 siblings, 0 replies; 2+ messages in thread
From: Peter Korsgaard @ 2022-11-22 6:59 UTC (permalink / raw)
To: Liu Shixin
Cc: Vinod Koul, Michal Simek, dmaengine, linux-arm-kernel, linux-kernel
>>>>> "Liu" == Liu Shixin <liushixin2@huawei.com> writes:
> 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: 9cd4360de609 ("dma: Add Xilinx AXI Video Direct Memory Access Engine driver support")
> Signed-off-by: Liu Shixin <liushixin2@huawei.com>
Acked-by: Peter Korsgaard <peter@korsgaard.com>
> ---
> drivers/dma/xilinx/xilinx_dma.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
> diff --git a/drivers/dma/xilinx/xilinx_dma.c b/drivers/dma/xilinx/xilinx_dma.c
> index 8cd4e69dc7b4..766017570488 100644
> --- a/drivers/dma/xilinx/xilinx_dma.c
> +++ b/drivers/dma/xilinx/xilinx_dma.c
> @@ -3141,8 +3141,10 @@ static int xilinx_dma_probe(struct platform_device *pdev)
> /* Initialize the channels */
> for_each_child_of_node(node, child) {
> err = xilinx_dma_child_probe(xdev, child);
> - if (err < 0)
> + if (err < 0) {
> + of_node_put(child);
> goto error;
> + }
> }
> if (xdev->dma_config->dmatype == XDMA_TYPE_VDMA) {
> --
> 2.25.1
--
Bye, Peter Korsgaard
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-11-22 6:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-22 2:16 [PATCH] dmaengine: xilinx_dma: call of_node_put() when breaking out of for_each_child_of_node() Liu Shixin
2022-11-22 6:59 ` Peter Korsgaard
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®