* [PATCH] ARM: milbeaut: Fix refcount leak in m10v_smp_init
@ 2022-05-12 8:15 Miaoqian Lin
2022-05-13 6:51 ` Sugaya Taichi
0 siblings, 1 reply; 2+ messages in thread
From: Miaoqian Lin @ 2022-05-12 8:15 UTC (permalink / raw)
To: Russell King, Taichi Sugaya, Takao Orito, Arnd Bergmann,
linux-arm-kernel, linux-kernel
Cc: linmq006
of_find_compatible_node() returns a node pointer with refcount
incremented, we should use of_node_put() on it when done.
Add missing of_node_put() to avoid refcount leak.
Fixes: 9fb29c734f9e ("ARM: milbeaut: Add basic support for Milbeaut m10v SoC")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
---
arch/arm/mach-milbeaut/platsmp.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm/mach-milbeaut/platsmp.c b/arch/arm/mach-milbeaut/platsmp.c
index 3ea880f5fcb7..1f1ff21c7140 100644
--- a/arch/arm/mach-milbeaut/platsmp.c
+++ b/arch/arm/mach-milbeaut/platsmp.c
@@ -53,6 +53,7 @@ static void m10v_smp_init(unsigned int max_cpus)
return;
m10v_smp_base = of_iomap(np, 0);
+ of_node_put(np);
if (!m10v_smp_base)
return;
--
2.25.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] ARM: milbeaut: Fix refcount leak in m10v_smp_init
2022-05-12 8:15 [PATCH] ARM: milbeaut: Fix refcount leak in m10v_smp_init Miaoqian Lin
@ 2022-05-13 6:51 ` Sugaya Taichi
0 siblings, 0 replies; 2+ messages in thread
From: Sugaya Taichi @ 2022-05-13 6:51 UTC (permalink / raw)
To: Miaoqian Lin, Russell King, Takao Orito, Arnd Bergmann,
linux-arm-kernel, linux-kernel
Thank you for the patch!
Acked-by: Sugaya Taichi <sugaya.taichi@socionext.com>
On 2022/05/12 17:15, Miaoqian Lin wrote:
> of_find_compatible_node() returns a node pointer with refcount
> incremented, we should use of_node_put() on it when done.
> Add missing of_node_put() to avoid refcount leak.
>
> Fixes: 9fb29c734f9e ("ARM: milbeaut: Add basic support for Milbeaut m10v SoC")
> Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
> ---
> arch/arm/mach-milbeaut/platsmp.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/arch/arm/mach-milbeaut/platsmp.c b/arch/arm/mach-milbeaut/platsmp.c
> index 3ea880f5fcb7..1f1ff21c7140 100644
> --- a/arch/arm/mach-milbeaut/platsmp.c
> +++ b/arch/arm/mach-milbeaut/platsmp.c
> @@ -53,6 +53,7 @@ static void m10v_smp_init(unsigned int max_cpus)
> return;
>
> m10v_smp_base = of_iomap(np, 0);
> + of_node_put(np);
> if (!m10v_smp_base)
> return;
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-05-13 6:52 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-12 8:15 [PATCH] ARM: milbeaut: Fix refcount leak in m10v_smp_init Miaoqian Lin
2022-05-13 6:51 ` Sugaya Taichi
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®