Skip to content

Commit 34d2cd3

Browse files
Yuuoniysuperna9999
authored andcommitted
ARM: meson: Fix refcount leak in meson_smp_prepare_cpus
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: d850f3e ("ARM: meson: Add SMP bringup code for Meson8 and Meson8b") Signed-off-by: Miaoqian Lin <[email protected]> Reviewed-by: Martin Blumenstingl <[email protected]> Signed-off-by: Neil Armstrong <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent f2906aa commit 34d2cd3

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

arch/arm/mach-meson/platsmp.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ static void __init meson_smp_prepare_cpus(const char *scu_compatible,
7171
}
7272

7373
sram_base = of_iomap(node, 0);
74+
of_node_put(node);
7475
if (!sram_base) {
7576
pr_err("Couldn't map SRAM registers\n");
7677
return;
@@ -91,6 +92,7 @@ static void __init meson_smp_prepare_cpus(const char *scu_compatible,
9192
}
9293

9394
scu_base = of_iomap(node, 0);
95+
of_node_put(node);
9496
if (!scu_base) {
9597
pr_err("Couldn't map SCU registers\n");
9698
return;

0 commit comments

Comments
 (0)