From: Miaoqian Lin <linmq006@gmail.com>
To: Huacai Chen <chenhuacai@kernel.org>,
WANG Xuerui <kernel@xen0n.name>,
Binbin Zhou <zhoubinbin@loongson.cn>,
Hongliang Wang <wanghongliang@loongson.cn>,
loongarch@lists.linux.dev, linux-kernel@vger.kernel.org
Cc: linmq006@gmail.com
Subject: [PATCH] Loongarch: Fix device node refcount leak in fdt_cpu_clk_init
Date: Wed, 19 Mar 2025 10:54:10 +0800 [thread overview]
Message-ID: <20250319025413.67014-1-linmq006@gmail.com> (raw)
Add missing of_node_put() to properly handle the reference count of the
device node obtained from of_get_cpu_node().
Fixes: 44a01f1f726a ("LoongArch: Parsing CPU-related information from DTS")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
---
arch/loongarch/kernel/env.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/loongarch/kernel/env.c b/arch/loongarch/kernel/env.c
index 2f1f5b08638f..01aea44cf4b0 100644
--- a/arch/loongarch/kernel/env.c
+++ b/arch/loongarch/kernel/env.c
@@ -68,6 +68,7 @@ static int __init fdt_cpu_clk_init(void)
return -ENODEV;
clk = of_clk_get(np, 0);
+ of_node_put(np);
if (IS_ERR(clk))
return -ENODEV;
--
2.39.5 (Apple Git-154)
next reply other threads:[~2025-03-19 2:54 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-19 2:54 Miaoqian Lin [this message]
2025-03-30 9:43 ` Huacai Chen
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=20250319025413.67014-1-linmq006@gmail.com \
--to=linmq006@gmail.com \
--cc=chenhuacai@kernel.org \
--cc=kernel@xen0n.name \
--cc=linux-kernel@vger.kernel.org \
--cc=loongarch@lists.linux.dev \
--cc=wanghongliang@loongson.cn \
--cc=zhoubinbin@loongson.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®