ARM: highbank: Fix refcount leak in highbank_init
PATCH 1/1 ARM: highbank: Fix refcount leak in highbank_init
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 220e6cf7b793 ("ARM: add Highbank core platform support")
Signed-off-by Miaoqian Lin <[email protected]>
--- arch/arm/mach-highbank/highbank.c | 1 + 1 file changed, 1 insertion(+)
arch/arm/mach-highbank/highbank.c +1 -0
@@ -142,6 +142,7 @@ static void __init highbank_init(void) np =of_find_compatible_node (NULL ,NULL ,"calxeda,hb-sregs" ); sregs_base =of_iomap (np,0 );WARN_ON (!sregs_base); +of_node_put (np); pm_power_off = highbank_power_off;highbank_pm_init ();
Signature · 1 line
2.25.1
Andre Przywara
maintainerOn Thu, 12 May 2022 07:12:58 +0400
Miaoqian Lin <[email protected]> wrote:
Hi,
Quoted 6 lines
of_find_compatible_node()returns a node pointer with refcount incremented, we should useof_node_put()on it when done. Add missingof_node_put()to avoid refcount leak.Fixes 220e6cf7b793 ("ARM: add Highbank core platform support")Signed-off-by Miaoqian Lin <[email protected]>
That is basically the same patch as this one:
https://lore.kernel.org/linux-arm-kernel/[email protected]/
Arnd, Olof, can you please take the older one through the soc tree? Maybe adding the Fixes tag from this one?
Thanks,
Andre
Quoted 16 lines
--- arch/arm/mach-highbank/highbank.c | 1 + 1 file changed, 1 insertion(+)arch/arm/mach-highbank/highbank.c +1
-0@@ -142,6 +142,7 @@ static void __init highbank_init(void) np =of_find_compatible_node (NULL ,NULL ,"calxeda,hb-sregs" ); sregs_base =of_iomap (np,0 );WARN_ON (!sregs_base); +of_node_put (np); pm_power_off = highbank_power_off;highbank_pm_init ();