Skip to content

Commit 7f92f28

Browse files
javiercarrascocruzgregkh
authored andcommitted
dmaengine: mv_xor: fix child node refcount handling in early exit
commit 362f1bf upstream. 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: [email protected] Fixes: f7d12ef ("dma: mv_xor: add Device Tree binding") Signed-off-by: Javier Carrasco <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 908806a commit 7f92f28

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
@@ -1393,6 +1393,7 @@ static int mv_xor_probe(struct platform_device *pdev)
13931393
irq = irq_of_parse_and_map(np, 0);
13941394
if (!irq) {
13951395
ret = -ENODEV;
1396+
of_node_put(np);
13961397
goto err_channel_add;
13971398
}
13981399

@@ -1401,6 +1402,7 @@ static int mv_xor_probe(struct platform_device *pdev)
14011402
if (IS_ERR(chan)) {
14021403
ret = PTR_ERR(chan);
14031404
irq_dispose_mapping(irq);
1405+
of_node_put(np);
14041406
goto err_channel_add;
14051407
}
14061408

0 commit comments

Comments
 (0)