Skip to content

Commit 362f1bf

Browse files
javiercarrascocruzvinodkoul
authored andcommitted
dmaengine: mv_xor: fix child node refcount handling in early exit
The for_each_child_of_node() loop requires explicit calls to of_node_put() to decrement the child's refcount upon early exits (break, goto, return). Add the missing calls in the two early exits before the goto instructions. Cc: stable@vger.kernel.org Fixes: f7d12ef ("dma: mv_xor: add Device Tree binding") Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com> Link: https://lore.kernel.org/r/20241011-dma_mv_xor_of_node_put-v1-1-3c2de819f463@gmail.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
1 parent ccfa313 commit 362f1bf

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/dma/mv_xor.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1388,6 +1388,7 @@ static int mv_xor_probe(struct platform_device *pdev)
13881388
irq = irq_of_parse_and_map(np, 0);
13891389
if (!irq) {
13901390
ret = -ENODEV;
1391+
of_node_put(np);
13911392
goto err_channel_add;
13921393
}
13931394

@@ -1396,6 +1397,7 @@ static int mv_xor_probe(struct platform_device *pdev)
13961397
if (IS_ERR(chan)) {
13971398
ret = PTR_ERR(chan);
13981399
irq_dispose_mapping(irq);
1400+
of_node_put(np);
13991401
goto err_channel_add;
14001402
}
14011403

0 commit comments

Comments
 (0)