Skip to contentSkip to conversation

powerpc/85xx: Fix reference leak in xes_mpc85xx_setup_arch

PATCH Superseded Miaoqian Lin 1 participant 1 message Jun 3, 2022

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc/85xx: Fix reference leak in xes_mpc85xx_setup_arch

of_find_node_by_path() returns remote device nodepointer with refcount incremented, we should use of_node_put() on it when done. Add missing of_node_put() to avoid refcount leak.

Fixes format:3038acf9091f ("powerpc/85xx: Add platform support for X-ES MPC85xx boards")
---
 arch/powerpc/platforms/85xx/xes_mpc85xx.c | 2 ++
 1 file changed, 2 insertions(+)
arch/powerpc/platforms/85xx/xes_mpc85xx.c +2 -0
index 5836e4ecb7a0..93f67b430714 100644
@@ -130,6 +130,8 @@ static void __init xes_mpc85xx_setup_arch(void)
 	mpc85xx_smp_init();
 
 	fsl_pci_assign_primary();
+
+	of_node_put(root);
 }
 
 machine_arch_initcall(xes_mpc8572, mpc85xx_common_publish_devices);
Signature · 1 line
2.25.1