* [PATCH] arm: mach-imx: Fix refcount leak bug in src
@ 2022-06-17 12:12 Liang He
2022-06-17 15:39 ` Philipp Zabel
2022-06-22 9:00 ` Krzysztof Kozlowski
0 siblings, 2 replies; 4+ messages in thread
From: Liang He @ 2022-06-17 12:12 UTC (permalink / raw)
To: linux, s.hauer, kernel, p.zabel, saravanak
Cc: windhl, linux-arm-kernel, linux-kernel
In imx7_src_init(), of_find_compatible_node() will return a node
pointer with refcount incremented. We should use of_node_put() when
it is not used anymore.
Signed-off-by: Liang He <windhl@126.com>
---
arch/arm/mach-imx/src.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/arm/mach-imx/src.c b/arch/arm/mach-imx/src.c
index 59a8e8cc4469..fff2776f9180 100644
--- a/arch/arm/mach-imx/src.c
+++ b/arch/arm/mach-imx/src.c
@@ -195,6 +195,7 @@ void __init imx7_src_init(void)
return;
src_base = of_iomap(np, 0);
+ of_node_put(np);
if (!src_base)
return;
@@ -203,6 +204,7 @@ void __init imx7_src_init(void)
return;
gpc_base = of_iomap(np, 0);
+ of_node_put(np);
if (!gpc_base)
return;
}
--
2.25.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] arm: mach-imx: Fix refcount leak bug in src
2022-06-17 12:12 [PATCH] arm: mach-imx: Fix refcount leak bug in src Liang He
@ 2022-06-17 15:39 ` Philipp Zabel
2022-06-17 15:54 ` Liang He
2022-06-22 9:00 ` Krzysztof Kozlowski
1 sibling, 1 reply; 4+ messages in thread
From: Philipp Zabel @ 2022-06-17 15:39 UTC (permalink / raw)
To: Liang He, linux, s.hauer, kernel, saravanak
Cc: linux-arm-kernel, linux-kernel
Hi,
On Fr, 2022-06-17 at 20:12 +0800, Liang He wrote:
> In imx7_src_init(), of_find_compatible_node() will return a node
> pointer with refcount incremented. We should use of_node_put() when
> it is not used anymore.
>
> Signed-off-by: Liang He <windhl@126.com>
> ---
> arch/arm/mach-imx/src.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/arch/arm/mach-imx/src.c b/arch/arm/mach-imx/src.c
> index 59a8e8cc4469..fff2776f9180 100644
> --- a/arch/arm/mach-imx/src.c
> +++ b/arch/arm/mach-imx/src.c
> @@ -195,6 +195,7 @@ void __init imx7_src_init(void)
> return;
>
>
>
>
> src_base = of_iomap(np, 0);
> + of_node_put(np);
Thank you for the patch. There is another instance of this pattern a
few lines above, in imx_src_init().
regards
Philipp
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re:Re: [PATCH] arm: mach-imx: Fix refcount leak bug in src
2022-06-17 15:39 ` Philipp Zabel
@ 2022-06-17 15:54 ` Liang He
0 siblings, 0 replies; 4+ messages in thread
From: Liang He @ 2022-06-17 15:54 UTC (permalink / raw)
To: Philipp Zabel
Cc: linux, s.hauer, kernel, saravanak, linux-arm-kernel, linux-kernel
At 2022-06-17 23:39:43, "Philipp Zabel" <p.zabel@pengutronix.de> wrote:
>Hi,
>
>On Fr, 2022-06-17 at 20:12 +0800, Liang He wrote:
>> In imx7_src_init(), of_find_compatible_node() will return a node
>> pointer with refcount incremented. We should use of_node_put() when
>> it is not used anymore.
>>
>> Signed-off-by: Liang He <windhl@126.com>
>> ---
>> arch/arm/mach-imx/src.c | 2 ++
>> 1 file changed, 2 insertions(+)
>>
>> diff --git a/arch/arm/mach-imx/src.c b/arch/arm/mach-imx/src.c
>> index 59a8e8cc4469..fff2776f9180 100644
>> --- a/arch/arm/mach-imx/src.c
>> +++ b/arch/arm/mach-imx/src.c
>> @@ -195,6 +195,7 @@ void __init imx7_src_init(void)
>> return;
>>
>>
>>
>>
>> src_base = of_iomap(np, 0);
>> + of_node_put(np);
>
>Thank you for the patch. There is another instance of this pattern a
>few lines above, in imx_src_init().
>
>regards
>Philipp
Thanks very much for your reply, Philipp.
In fact, I have confirmed if there is any existed same patch in
lore.kernel.org before I begin to send my patch.
So there is indeed a patch reported by Miaoqian for imx_src_init().
However, that patch does not consider the bug in imx7_src_init().
Thanks again.
Liang
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] arm: mach-imx: Fix refcount leak bug in src
2022-06-17 12:12 [PATCH] arm: mach-imx: Fix refcount leak bug in src Liang He
2022-06-17 15:39 ` Philipp Zabel
@ 2022-06-22 9:00 ` Krzysztof Kozlowski
1 sibling, 0 replies; 4+ messages in thread
From: Krzysztof Kozlowski @ 2022-06-22 9:00 UTC (permalink / raw)
To: Liang He, linux, s.hauer, kernel, p.zabel, saravanak
Cc: linux-arm-kernel, linux-kernel
On 17/06/2022 14:12, Liang He wrote:
> In imx7_src_init(), of_find_compatible_node() will return a node
> pointer with refcount incremented. We should use of_node_put() when
> it is not used anymore.
>
> Signed-off-by: Liang He <windhl@126.com>
> ---
Before applying the patch please check it carefully. Previous evidence
[1][2] suggests that not it was not even compiled.
[1] https://lore.kernel.org/all/202206221602.odN70SHs-lkp@intel.com/
[2]
https://lore.kernel.org/all/16f9a971.44e5.1817068ee3c.Coremail.windhl@126.com/
Best regards,
Krzysztof
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-06-22 9:02 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-17 12:12 [PATCH] arm: mach-imx: Fix refcount leak bug in src Liang He
2022-06-17 15:39 ` Philipp Zabel
2022-06-17 15:54 ` Liang He
2022-06-22 9:00 ` Krzysztof Kozlowski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).