Skip to contentSkip to conversation

arm: mach-socfpga: Fix refcount leak bug in platsmp

PATCH New Liang He 1 participant 1 message Jun 17, 2022

Subsystems (3)
lore
Share & tools
lore

Liang He

author
#0 lore raw

PATCH 1/1 arm: mach-socfpga: Fix refcount leak bug in platsmp

In socfpga_smp_prepare_cpus(), of_find_compatible_node() will return a node pointer with refcount incremented. We should use of_node_put() when it is not used anymore.

---
 arch/arm/mach-socfpga/platsmp.c | 1 +
 1 file changed, 1 insertion(+)
arch/arm/mach-socfpga/platsmp.c +1 -0
index 201191cf68f3..349e6c54518e 100644
@@ -78,6 +78,7 @@ static void __init socfpga_smp_prepare_cpus(unsigned int max_cpus)
 	}
 
 	socfpga_scu_base_addr = of_iomap(np, 0);
+	of_node_put(np);
 	if (!socfpga_scu_base_addr)
 		return;
 	scu_enable(socfpga_scu_base_addr);
Signature · 1 line
2.25.1