Skip to contentSkip to conversation

arm: mach-imx: Fix refcount leak in mm-imx3.c

PATCH Superseded Liang He 1 participant 1 message Jun 16, 2022

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Liang He

author
#0 lore raw

PATCH 1/1 arm: mach-imx: Fix refcount leak in mm-imx3.c

In imx31_init_early(), 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-imx/mm-imx3.c | 1 +
 1 file changed, 1 insertion(+)
arch/arm/mach-imx/mm-imx3.c +1 -0
index 28db97289ee8..0944ffb08f40 100644
@@ -107,6 +107,7 @@ void __init imx31_init_early(void)
 	arm_pm_idle = imx31_idle;
 	np = of_find_compatible_node(NULL, NULL, "fsl,imx31-ccm");
 	mx3_ccm_base = of_iomap(np, 0);
+	of_node_put(np);
 	BUG_ON(!mx3_ccm_base);
 }
 #endif /* ifdef CONFIG_SOC_IMX31 */
Signature · 1 line
2.25.1