* [PATCH] ARM: highbank: Fix missing of_node_put in highbank_init()
@ 2022-04-08 9:48 cgel.zte
2022-04-20 14:26 ` Andre Przywara
0 siblings, 1 reply; 2+ messages in thread
From: cgel.zte @ 2022-04-08 9:48 UTC (permalink / raw)
To: andre.przywara, linux; +Cc: linux-arm-kernel, linux-kernel, Lv Ruyi, Zeal Robot
From: Lv Ruyi <lv.ruyi@zte.com.cn>
of_find_compatible_node() returns node pointer with refcount incremented,
use of_node_put() on it to decrease refcount when done.
Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Lv Ruyi <lv.ruyi@zte.com.cn>
---
arch/arm/mach-highbank/highbank.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm/mach-highbank/highbank.c b/arch/arm/mach-highbank/highbank.c
index db607955a7e4..fe82c3d16ffd 100644
--- a/arch/arm/mach-highbank/highbank.c
+++ b/arch/arm/mach-highbank/highbank.c
@@ -141,6 +141,7 @@ static void __init highbank_init(void)
/* Map system registers */
np = of_find_compatible_node(NULL, NULL, "calxeda,hb-sregs");
sregs_base = of_iomap(np, 0);
+ of_node_put(np);
WARN_ON(!sregs_base);
pm_power_off = highbank_power_off;
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ARM: highbank: Fix missing of_node_put in highbank_init()
2022-04-08 9:48 [PATCH] ARM: highbank: Fix missing of_node_put in highbank_init() cgel.zte
@ 2022-04-20 14:26 ` Andre Przywara
0 siblings, 0 replies; 2+ messages in thread
From: Andre Przywara @ 2022-04-20 14:26 UTC (permalink / raw)
To: cgel.zte
Cc: linux, linux-arm-kernel, linux-kernel, Lv Ruyi, Zeal Robot,
Rob Herring, Arnd Bergmann, Olof Johansson
On Fri, 8 Apr 2022 09:48:17 +0000
cgel.zte@gmail.com wrote:
Hi,
> From: Lv Ruyi <lv.ruyi@zte.com.cn>
>
> of_find_compatible_node() returns node pointer with refcount incremented,
> use of_node_put() on it to decrease refcount when done.
Thanks for the patch, looks alright to me.
There is actually another occurrence in the same file, will send a patch
ASAP.
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: Lv Ruyi <lv.ruyi@zte.com.cn>
Fixes: 220e6cf7b793d702596506a8c4bf1f4fd4040df1 ("ARM: add Highbank core
platform support")
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Arnd, Olof, can you please take this through the soc tree as a fix,
whenever you find time?
Thanks!
Andre
> ---
> arch/arm/mach-highbank/highbank.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/arch/arm/mach-highbank/highbank.c b/arch/arm/mach-highbank/highbank.c
> index db607955a7e4..fe82c3d16ffd 100644
> --- a/arch/arm/mach-highbank/highbank.c
> +++ b/arch/arm/mach-highbank/highbank.c
> @@ -141,6 +141,7 @@ static void __init highbank_init(void)
> /* Map system registers */
> np = of_find_compatible_node(NULL, NULL, "calxeda,hb-sregs");
> sregs_base = of_iomap(np, 0);
> + of_node_put(np);
> WARN_ON(!sregs_base);
>
> pm_power_off = highbank_power_off;
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-04-20 14:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-08 9:48 [PATCH] ARM: highbank: Fix missing of_node_put in highbank_init() cgel.zte
2022-04-20 14:26 ` Andre Przywara
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).