dmaengine: xilinx_dma: call of_node_put() when breaking out of for_each_child_of_node()
Subsystems (2)
PATCH 1/1 dmaengine: xilinx_dma: call of_node_put() when breaking out of for_each_child_of_node()
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 <[email protected]>
--- drivers/dma/xilinx/xilinx_dma.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/dma/xilinx/xilinx_dma.c +3 -1
@@ -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 ) {
Signature · 1 line
2.25.1
Quoted 7 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Liu" == Liu Shixin <[email protected]> writes:
Since
for_each_child_of_node()will increase the refcount of node, we need to callof_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 <[email protected]>
Acked-by Peter Korsgaard <[email protected]>
Quoted 23 lines
--- drivers/dma/xilinx/xilinx_dma.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/dma/xilinx/xilinx_dma.c +3
-1@@ -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 ) {Signature · 1 line
2.25.1
Signature · 1 line
Bye, Peter Korsgaard