linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc: icp-hv: fix missing of_node_put in success path
@ 2018-07-04  8:03 Nicholas Mc Guire
  2020-09-09 13:37 ` Michael Ellerman
  0 siblings, 1 reply; 2+ messages in thread
From: Nicholas Mc Guire @ 2018-07-04  8:03 UTC (permalink / raw)
  To: Benjamin Herrenschmidt
  Cc: Paul Mackerras, Michael Ellerman, linuxppc-dev, linux-kernel,
	Nicholas Mc Guire

 Both of_find_compatible_node() and of_find_node_by_type() will
return a refcounted node on success - thus for the success path
the node must be explicitly released with a of_node_put().

Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Fixes: commit 0b05ac6e2480 ("powerpc/xics: Rewrite XICS driver")
---
Problem found by experimental coccinelle script

Patch was compiletested with: ppc64_defconfig (implies
CONFIG_PPC_ICP_HV=y)
with sparse warnings though not related to the proposed change

Patch is against 4.18-rc3 (localversion-next is next-20180704)

 arch/powerpc/sysdev/xics/icp-hv.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/powerpc/sysdev/xics/icp-hv.c b/arch/powerpc/sysdev/xics/icp-hv.c
index bbc839a..003deaa 100644
--- a/arch/powerpc/sysdev/xics/icp-hv.c
+++ b/arch/powerpc/sysdev/xics/icp-hv.c
@@ -179,6 +179,7 @@ int icp_hv_init(void)
 
 	icp_ops = &icp_hv_ops;
 
+	of_node_put(np);
 	return 0;
 }
 
-- 
2.1.4


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

* Re: [PATCH] powerpc: icp-hv: fix missing of_node_put in success path
  2018-07-04  8:03 [PATCH] powerpc: icp-hv: fix missing of_node_put in success path Nicholas Mc Guire
@ 2020-09-09 13:37 ` Michael Ellerman
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Ellerman @ 2020-09-09 13:37 UTC (permalink / raw)
  To: Benjamin Herrenschmidt, Nicholas Mc Guire
  Cc: Paul Mackerras, Michael Ellerman, linux-kernel, linuxppc-dev

On Wed, 4 Jul 2018 10:03:27 +0200, Nicholas Mc Guire wrote:
>  Both of_find_compatible_node() and of_find_node_by_type() will
> return a refcounted node on success - thus for the success path
> the node must be explicitly released with a of_node_put().

Applied to powerpc/next.

[1/1] powerpc/icp-hv: Fix missing of_node_put() in success path
      https://git.kernel.org/powerpc/c/d3e669f31ec35856f5e85df9224ede5bdbf1bc7b

cheers

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

end of thread, other threads:[~2020-09-09 16:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-04  8:03 [PATCH] powerpc: icp-hv: fix missing of_node_put in success path Nicholas Mc Guire
2020-09-09 13:37 ` Michael Ellerman

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).