Skip to contentSkip to conversation

arm: mach-imx: Add missing of_node_put in cpu-imx27.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-imx27.c

In mx27_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-imx27.c | 3 +++
 1 file changed, 3 insertions(+)
arch/arm/mach-imx/cpu-imx27.c +3 -0
index bf70e13bbe9e..220622c9d2f0 100644
@@ -28,6 +28,9 @@ static int mx27_read_cpu_rev(void)
 
 	np = of_find_compatible_node(NULL, NULL, "fsl,imx27-ccm");
 	ccm_base = of_iomap(np, 0);
+	
+	of_node_put(np);
+	
 	BUG_ON(!ccm_base);
 	/*
 	 * now we have access to the IO registers. As we need
Signature · 7 lines
2.25.1


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel