DORMANTno replies

[PATCH v2] ARM: milbeaut: Fix possible device node reference leak

From: Yi Wang <hidden>
Date: 2020-07-25 00:13:26
Also in: lkml
Subsystem: arm port, arm/milbeaut architecture, the rest · Maintainers: Russell King, Taichi Sugaya, Takao Orito, Linus Torvalds

From: Liao Pingfang <redacted>

The variable np in function m10v_smp_init takes the return value
of of_find_compatible_node, which gets a node but does not put it. If
this node is not put it may cause a memory leak. Hence put np after its
life has been exhausted.

Signed-off-by: Liao Pingfang <redacted>
Signed-off-by: Yi Wang <redacted>
---
Changes in v2: improve the subject and description of this commit.

 arch/arm/mach-milbeaut/platsmp.c | 1 +
 1 file changed, 1 insertion(+)
diff --git a/arch/arm/mach-milbeaut/platsmp.c b/arch/arm/mach-milbeaut/platsmp.c
index 3ea880f..1f1ff21 100644
--- a/arch/arm/mach-milbeaut/platsmp.c
+++ b/arch/arm/mach-milbeaut/platsmp.c
@@ -53,6 +53,7 @@ static void m10v_smp_init(unsigned int max_cpus)
 		return;
 
 	m10v_smp_base = of_iomap(np, 0);
+	of_node_put(np);
 	if (!m10v_smp_base)
 		return;
 
-- 
2.9.5


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help