From: Miaoqian Lin <linmq006@gmail.com>
To: "David S. Miller" <davem@davemloft.net>,
Miaoqian Lin <linmq006@gmail.com>,
sparclinux@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 1/3] sparc: kernel: Fix reference leak in jbusmc_probe
Date: Tue, 7 Jun 2022 07:33:00 +0400 [thread overview]
Message-ID: <20220607033306.688-3-linmq006@gmail.com> (raw)
In-Reply-To: <20220607033306.688-1-linmq006@gmail.com>
of_find_node_by_path() returns a node pointer with refcount incremented,
we should use of_node_put() on it when not need anymore.
Add missing of_node_put() to avoid refcount leak.
Fixes: 85269eb5542b ("sparc64: Add JBUS UltraSPARC-IIIi support to memory controller driver.")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
---
arch/sparc/kernel/chmc.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/sparc/kernel/chmc.c b/arch/sparc/kernel/chmc.c
index 6ff43df740e0..9cc1b92ffff9 100644
--- a/arch/sparc/kernel/chmc.c
+++ b/arch/sparc/kernel/chmc.c
@@ -409,6 +409,7 @@ static int jbusmc_probe(struct platform_device *op)
goto out;
}
mem_regs = of_get_property(mem_node, "reg", &len);
+ of_node_put(mem_node);
if (!mem_regs) {
printk(KERN_ERR PFX "Cannot get reg property of /memory node.\n");
goto out;
--
2.25.1
prev parent reply other threads:[~2022-06-07 3:34 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-07 3:32 [PATCH 2/3] sparc: Fix reference leak in scan_of_devices Miaoqian Lin
2022-06-07 3:32 ` [PATCH 3/3] sparc: prom: Fix reference leak in of_console_init Miaoqian Lin
2022-06-07 3:33 ` Miaoqian Lin [this message]
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=20220607033306.688-3-linmq006@gmail.com \
--to=linmq006@gmail.com \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=sparclinux@vger.kernel.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