Loongarch: Fix device node refcount leak in fdt_cpu_clk_init
PATCH 1/1 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 <[email protected]>
--- arch/loongarch/kernel/env.c | 1 + 1 file changed, 1 insertion(+)
arch/loongarch/kernel/env.c +1 -0
@@ -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 ;
Signature · 1 line
2.39.5 (Apple Git-154)
Applied, thanks.
Huacai
Quoted 25 lines · Miaoqian Lin
Add missing
of_node_put()to properly handle the reference count of the device node obtained fromof_get_cpu_node().Fixes 44a01f1f726a ("LoongArch: Parsing CPU-related information from DTS")Signed-off-by Miaoqian Lin <[email protected]>--- arch/loongarch/kernel/env.c | 1 + 1 file changed, 1 insertion(+)arch/loongarch/kernel/env.c +1
-1@@ -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)