summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiaoqian Lin <linmq006@gmail.com>2025-03-30 16:31:09 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-04-10 14:41:51 +0200
commit3c17da7863d6d3e643dad7392bec89bd166e0833 (patch)
tree1be38bf3d1ffec507f673b9b7d76b8e0d974ca07
parent7e75c9ddcb61022770a87fcae10e47ec9041254c (diff)
LoongArch: Fix device node refcount leak in fdt_cpu_clk_init()
[ Upstream commit 2e3bc71e4f394ecf8f499d21923cf556b4bfa1e7 ] 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> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--arch/loongarch/kernel/env.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/loongarch/kernel/env.c b/arch/loongarch/kernel/env.c
index 2f1f5b08638f..27144de5c5fe 100644
--- a/arch/loongarch/kernel/env.c
+++ b/arch/loongarch/kernel/env.c
@@ -68,6 +68,8 @@ 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;