Skip to contentSkip to conversation

arm: mach-imx: Add missing of_node_put() in cpu-imx31.c

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

Subsystems (3)
lore
Share & tools
lore

Liang He

author
#0 lore raw

PATCH 1/1 arm: mach-imx: Add missing of_node_put() in cpu-imx31.c

In mx31_read_cpu_rev(), 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/cpu-imx31.c | 3 +++
 1 file changed, 3 insertions(+)
arch/arm/mach-imx/cpu-imx31.c +3 -0
index b9c24b851d1a..cff6be524626 100644
@@ -39,6 +39,9 @@ static int mx31_read_cpu_rev(void)
 
 	np = of_find_compatible_node(NULL, NULL, "fsl,imx31-iim");
 	iim_base = of_iomap(np, 0);
+	
+	of_node_put(np);
+	
 	BUG_ON(!iim_base);
 
 	/* read SREV register from IIM module */
Signature · 1 line
2.25.1