All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] ARM: milbeaut: Fix possible device node reference leak
@ 2020-07-25  0:16 ` Yi Wang
  0 siblings, 0 replies; 2+ messages in thread
From: Yi Wang @ 2020-07-25  0:16 UTC (permalink / raw)
  To: linux
  Cc: linux-arm-kernel, linux-kernel, xue.zhihong, wang.yi59,
	wang.liang82, Liao Pingfang

From: Liao Pingfang <liao.pingfang@zte.com.cn>

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 <liao.pingfang@zte.com.cn>
Signed-off-by: Yi Wang <wang.yi59@zte.com.cn>
---
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


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

* [PATCH v2] ARM: milbeaut: Fix possible device node reference leak
@ 2020-07-25  0:16 ` Yi Wang
  0 siblings, 0 replies; 2+ messages in thread
From: Yi Wang @ 2020-07-25  0:16 UTC (permalink / raw)
  To: linux
  Cc: wang.yi59, wang.liang82, linux-kernel, linux-arm-kernel,
	xue.zhihong, Liao Pingfang

From: Liao Pingfang <liao.pingfang@zte.com.cn>

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 <liao.pingfang@zte.com.cn>
Signed-off-by: Yi Wang <wang.yi59@zte.com.cn>
---
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

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

end of thread, other threads:[~2020-07-25  0:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-25  0:16 [PATCH v2] ARM: milbeaut: Fix possible device node reference leak Yi Wang
2020-07-25  0:16 ` Yi Wang

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.