linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arm: mach-imx: Fix refcount leak bug in src
@ 2022-06-17 12:12 Liang He
  2022-06-17 15:39 ` Philipp Zabel
  2022-06-22  9:00 ` Krzysztof Kozlowski
  0 siblings, 2 replies; 4+ messages in thread
From: Liang He @ 2022-06-17 12:12 UTC (permalink / raw)
  To: linux, s.hauer, kernel, p.zabel, saravanak
  Cc: windhl, linux-arm-kernel, linux-kernel

In imx7_src_init(), 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/src.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/mach-imx/src.c b/arch/arm/mach-imx/src.c
index 59a8e8cc4469..fff2776f9180 100644
--- a/arch/arm/mach-imx/src.c
+++ b/arch/arm/mach-imx/src.c
@@ -195,6 +195,7 @@ void __init imx7_src_init(void)
 		return;
 
 	src_base = of_iomap(np, 0);
+	of_node_put(np);
 	if (!src_base)
 		return;
 
@@ -203,6 +204,7 @@ void __init imx7_src_init(void)
 		return;
 
 	gpc_base = of_iomap(np, 0);
+	of_node_put(np);
 	if (!gpc_base)
 		return;
 }
-- 
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] 4+ messages in thread

end of thread, other threads:[~2022-06-22  9:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-17 12:12 [PATCH] arm: mach-imx: Fix refcount leak bug in src Liang He
2022-06-17 15:39 ` Philipp Zabel
2022-06-17 15:54   ` Liang He
2022-06-22  9:00 ` Krzysztof Kozlowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).