[PATCH] arch: powerpc: platforms: 85xx: Fix refcount leak bug in ksi8560.c

Subsystems: linux for powerpc (32-bit and 64-bit), linux for powerpc embedded ppc85xx, the rest

STALE1473d LANDED

Landed in mainline as 64e696af167f on 2022-09-05.

2 messages, 2 authors, 2022-09-09 · open the first message on its own page

[PATCH] arch: powerpc: platforms: 85xx: Fix refcount leak bug in ksi8560.c

From: Liang He <hidden>
Date: 2022-06-16 13:30:45

In ksi8560_setup_arch(), 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 <redacted>
---
 arch/powerpc/platforms/85xx/ksi8560.c | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/arch/powerpc/platforms/85xx/ksi8560.c b/arch/powerpc/platforms/85xx/ksi8560.c
index bdf9d42f8521..a22f02b0fc77 100644
--- a/arch/powerpc/platforms/85xx/ksi8560.c
+++ b/arch/powerpc/platforms/85xx/ksi8560.c
@@ -133,6 +133,8 @@ static void __init ksi8560_setup_arch(void)
 	else
 		printk(KERN_ERR "Can't find CPLD in device tree\n");
 
+	of_node_put(cpld);
+
 	if (ppc_md.progress)
 		ppc_md.progress("ksi8560_setup_arch()", 0);
 
-- 
2.25.1

Re: [PATCH] arch: powerpc: platforms: 85xx: Fix refcount leak bug in ksi8560.c

From: Michael Ellerman <hidden>
Date: 2022-09-09 12:11:44

On Thu, 16 Jun 2022 21:29:22 +0800, Liang He wrote:
In ksi8560_setup_arch(), of_find_compatible_node() will return a
node pointer with refcount incremented. We should use of_node_put()
when it is not used anymore.
Applied to powerpc/next.

[1/1] arch: powerpc: platforms: 85xx: Fix refcount leak bug in ksi8560.c
      https://git.kernel.org/powerpc/c/64e696af167f612cd1ecba89edfeb2353ca59947

cheers
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help