From: Miaoqian Lin <linmq006@gmail.com>
To: Scott Wood <oss@buserror.net>,
Michael Ellerman <mpe@ellerman.id.au>,
Benjamin Herrenschmidt <benh@kernel.crashing.org>,
Paul Mackerras <paulus@samba.org>,
Christophe Leroy <christophe.leroy@csgroup.eu>,
Miaoqian Lin <linmq006@gmail.com>,
Nick Child <nick.child@ibm.com>, Nate Case <ncase@xes-inc.com>,
Kumar Gala <galak@kernel.crashing.org>,
linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org
Subject: [PATCH v2] powerpc/85xx: Fix reference leak in xes_mpc85xx_setup_arch
Date: Fri, 3 Jun 2022 16:17:50 +0400 [thread overview]
Message-ID: <20220603121752.23548-1-linmq006@gmail.com> (raw)
of_find_node_by_path() returns remote device nodepointer with
refcount incremented, we should use of_node_put() on it when done.
Add missing of_node_put() to avoid refcount leak.
Fixes: 3038acf9091f ("powerpc/85xx: Add platform support for X-ES MPC85xx boards")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
---
changes in v2:
- update Fixes tag.
v1 Link: https://lore.kernel.org/all/20220603120907.19999-1-linmq006@gmail.com
---
arch/powerpc/platforms/85xx/xes_mpc85xx.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/powerpc/platforms/85xx/xes_mpc85xx.c b/arch/powerpc/platforms/85xx/xes_mpc85xx.c
index 5836e4ecb7a0..93f67b430714 100644
--- a/arch/powerpc/platforms/85xx/xes_mpc85xx.c
+++ b/arch/powerpc/platforms/85xx/xes_mpc85xx.c
@@ -130,6 +130,8 @@ static void __init xes_mpc85xx_setup_arch(void)
mpc85xx_smp_init();
fsl_pci_assign_primary();
+
+ of_node_put(root);
}
machine_arch_initcall(xes_mpc8572, mpc85xx_common_publish_devices);
--
2.25.1
next reply other threads:[~2022-06-03 12:18 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-03 12:17 Miaoqian Lin [this message]
2022-07-29 6:53 ` [PATCH v2] powerpc/85xx: Fix reference leak in xes_mpc85xx_setup_arch 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=20220603121752.23548-1-linmq006@gmail.com \
--to=linmq006@gmail.com \
--cc=benh@kernel.crashing.org \
--cc=christophe.leroy@csgroup.eu \
--cc=galak@kernel.crashing.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=ncase@xes-inc.com \
--cc=nick.child@ibm.com \
--cc=oss@buserror.net \
--cc=paulus@samba.org \
/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 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).