From: Miaoqian Lin Date: Sun, 30 Mar 2025 08:31:09 +0000 (+0800) Subject: LoongArch: Fix device node refcount leak in fdt_cpu_clk_init() X-Git-Tag: v6.15-rc1~58^2~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2e3bc71e4f394ecf8f499d21923cf556b4bfa1e7;p=thirdparty%2Fkernel%2Fstable.git LoongArch: Fix device node refcount leak in fdt_cpu_clk_init() 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 Signed-off-by: Huacai Chen --- diff --git a/arch/loongarch/kernel/env.c b/arch/loongarch/kernel/env.c index 2f1f5b08638f8..27144de5c5fe4 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;