* [PATCH] Loongarch: Fix device node refcount leak in fdt_cpu_clk_init
@ 2025-03-19 2:54 Miaoqian Lin
2025-03-30 9:43 ` Huacai Chen
0 siblings, 1 reply; 2+ messages in thread
From: Miaoqian Lin @ 2025-03-19 2:54 UTC (permalink / raw)
To: Huacai Chen, WANG Xuerui, Binbin Zhou, Hongliang Wang, loongarch,
linux-kernel
Cc: linmq006
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)
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] Loongarch: Fix device node refcount leak in fdt_cpu_clk_init
2025-03-19 2:54 [PATCH] Loongarch: Fix device node refcount leak in fdt_cpu_clk_init Miaoqian Lin
@ 2025-03-30 9:43 ` Huacai Chen
0 siblings, 0 replies; 2+ messages in thread
From: Huacai Chen @ 2025-03-30 9:43 UTC (permalink / raw)
To: Miaoqian Lin
Cc: WANG Xuerui, Binbin Zhou, Hongliang Wang, loongarch, linux-kernel
Applied, thanks.
Huacai
On Wed, Mar 19, 2025 at 10:54 AM Miaoqian Lin <linmq006@gmail.com> wrote:
>
> 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)
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-03-30 9:44 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-03-19 2:54 [PATCH] Loongarch: Fix device node refcount leak in fdt_cpu_clk_init Miaoqian Lin
2025-03-30 9:43 ` Huacai Chen
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®