All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] arm: mach-imx: Add missing of_node_put() in cpu-imx31.c
@ 2022-06-15 14:54 ` Liang He
  0 siblings, 0 replies; 2+ messages in thread
From: Liang He @ 2022-06-15 14:54 UTC (permalink / raw)
  To: linux, shawnguo, s.hauer, kernel, festevam, linux-imx
  Cc: linux-arm-kernel, linux-kernel, windhl

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.

Signed-off-by: Liang He <windhl@126.com>
---
 arch/arm/mach-imx/cpu-imx31.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/arm/mach-imx/cpu-imx31.c b/arch/arm/mach-imx/cpu-imx31.c
index b9c24b851d1a..cff6be524626 100644
--- a/arch/arm/mach-imx/cpu-imx31.c
+++ b/arch/arm/mach-imx/cpu-imx31.c
@@ -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 */
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH] arm: mach-imx: Add missing of_node_put() in cpu-imx31.c
@ 2022-06-15 14:54 ` Liang He
  0 siblings, 0 replies; 2+ messages in thread
From: Liang He @ 2022-06-15 14:54 UTC (permalink / raw)
  To: linux, shawnguo, s.hauer, kernel, festevam, linux-imx
  Cc: linux-arm-kernel, linux-kernel, windhl

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.

Signed-off-by: Liang He <windhl@126.com>
---
 arch/arm/mach-imx/cpu-imx31.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/arm/mach-imx/cpu-imx31.c b/arch/arm/mach-imx/cpu-imx31.c
index b9c24b851d1a..cff6be524626 100644
--- a/arch/arm/mach-imx/cpu-imx31.c
+++ b/arch/arm/mach-imx/cpu-imx31.c
@@ -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 */
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-06-15 14:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-15 14:54 [PATCH] arm: mach-imx: Add missing of_node_put() in cpu-imx31.c Liang He
2022-06-15 14:54 ` Liang He

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.