[PATCH] powerpc: 44x: Add of_node_put() when break out from for_each

Liang He windhl at 126.com
Fri Jul 1 23:31:26 AEST 2022


In ppc47x_init_irq(), we need to call of_node_put() when there is
a break during the iteration of for_each_node_with_property() which
will automatically increase and decrease the refcount.

Signed-off-by: Liang He <windhl at 126.com>
---
 arch/powerpc/platforms/44x/ppc476.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/powerpc/platforms/44x/ppc476.c b/arch/powerpc/platforms/44x/ppc476.c
index 20cc8f80b086..7d9075fb20c9 100644
--- a/arch/powerpc/platforms/44x/ppc476.c
+++ b/arch/powerpc/platforms/44x/ppc476.c
@@ -140,6 +140,7 @@ static void __init ppc47x_init_irq(void)
 		ppc_md.get_irq = mpic_get_irq;
 	} else
 		panic("Unrecognized top level interrupt controller");
+	of_node_put(np);
 }
 
 #ifdef CONFIG_SMP
-- 
2.25.1



More information about the Linuxppc-dev mailing list