Commit 362f1bf9 authored by Javier Carrasco's avatar Javier Carrasco Committed by Vinod Koul
Browse files

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: f7d12ef5 ("dma: mv_xor: add Device Tree binding")
Signed-off-by: default avatarJavier 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: default avatarVinod Koul <vkoul@kernel.org>
parent ccfa3131
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1388,6 +1388,7 @@ static int mv_xor_probe(struct platform_device *pdev)
			irq = irq_of_parse_and_map(np, 0);
			if (!irq) {
				ret = -ENODEV;
				of_node_put(np);
				goto err_channel_add;
			}

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