All of lore.kernel.org
 help / color / mirror / Atom feed
From: cgel.zte@gmail.com
To: mpe@ellerman.id.au
Cc: benh@kernel.crashing.org, paulus@samba.org, maz@kernel.org,
	nick.child@ibm.com, lv.ruyi@zte.com.cn,
	linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org,
	Zeal Robot <zealci@zte.com.cn>
Subject: [PATCH] powerpc/sysdev: fix refcount leak in icp_opal_init()
Date: Sat,  2 Apr 2022 01:34:19 +0000	[thread overview]
Message-ID: <20220402013419.2410298-1-lv.ruyi@zte.com.cn> (raw)

From: Lv Ruyi <lv.ruyi@zte.com.cn>

The of_find_compatible_node() function returns a node pointer with
refcount incremented, use of_node_put() on it when done.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Lv Ruyi <lv.ruyi@zte.com.cn>
---
 arch/powerpc/sysdev/xics/icp-opal.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/powerpc/sysdev/xics/icp-opal.c b/arch/powerpc/sysdev/xics/icp-opal.c
index bda4c32582d9..4dae624b9f2f 100644
--- a/arch/powerpc/sysdev/xics/icp-opal.c
+++ b/arch/powerpc/sysdev/xics/icp-opal.c
@@ -196,6 +196,7 @@ int __init icp_opal_init(void)
 
 	printk("XICS: Using OPAL ICP fallbacks\n");
 
+	of_node_put(np);
 	return 0;
 }
 
-- 
2.25.1


WARNING: multiple messages have this Message-ID (diff)
From: cgel.zte@gmail.com
To: mpe@ellerman.id.au
Cc: nick.child@ibm.com, lv.ruyi@zte.com.cn,
	linux-kernel@vger.kernel.org, paulus@samba.org, maz@kernel.org,
	linuxppc-dev@lists.ozlabs.org, Zeal Robot <zealci@zte.com.cn>
Subject: [PATCH] powerpc/sysdev: fix refcount leak in icp_opal_init()
Date: Sat,  2 Apr 2022 01:34:19 +0000	[thread overview]
Message-ID: <20220402013419.2410298-1-lv.ruyi@zte.com.cn> (raw)

From: Lv Ruyi <lv.ruyi@zte.com.cn>

The of_find_compatible_node() function returns a node pointer with
refcount incremented, use of_node_put() on it when done.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Lv Ruyi <lv.ruyi@zte.com.cn>
---
 arch/powerpc/sysdev/xics/icp-opal.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/powerpc/sysdev/xics/icp-opal.c b/arch/powerpc/sysdev/xics/icp-opal.c
index bda4c32582d9..4dae624b9f2f 100644
--- a/arch/powerpc/sysdev/xics/icp-opal.c
+++ b/arch/powerpc/sysdev/xics/icp-opal.c
@@ -196,6 +196,7 @@ int __init icp_opal_init(void)
 
 	printk("XICS: Using OPAL ICP fallbacks\n");
 
+	of_node_put(np);
 	return 0;
 }
 
-- 
2.25.1


             reply	other threads:[~2022-04-02  1:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-02  1:34 cgel.zte [this message]
2022-04-02  1:34 ` [PATCH] powerpc/sysdev: fix refcount leak in icp_opal_init() cgel.zte
2022-05-24 11:09 ` Michael Ellerman
2022-05-24 11:09   ` Michael Ellerman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220402013419.2410298-1-lv.ruyi@zte.com.cn \
    --to=cgel.zte@gmail.com \
    --cc=benh@kernel.crashing.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=lv.ruyi@zte.com.cn \
    --cc=maz@kernel.org \
    --cc=mpe@ellerman.id.au \
    --cc=nick.child@ibm.com \
    --cc=paulus@samba.org \
    --cc=zealci@zte.com.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.