Skip to content

Commit 60166b3

Browse files
committed
Merge tag 'hisi-armv7soc-for-5.19' of https://github.com/hisilicon/linux-hisi into arm/soc
HiSilicon ARMv7 SoC updates for v5.19 - Add of_node_put to avoid the refcount leak * tag 'hisi-armv7soc-for-5.19' of https://github.com/hisilicon/linux-hisi: ARM: hisi: Add missing of_node_put after of_find_compatible_node Link: https://lore.kernel.org/r/62762DF0.30602@hisilicon.com Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2 parents baf7cbb + 9bc72e4 commit 60166b3

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

arch/arm/mach-hisi/platsmp.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,17 @@ static void __init hi3xxx_smp_prepare_cpus(unsigned int max_cpus)
6767
}
6868
ctrl_base = of_iomap(np, 0);
6969
if (!ctrl_base) {
70+
of_node_put(np);
7071
pr_err("failed to map address\n");
7172
return;
7273
}
7374
if (of_property_read_u32(np, "smp-offset", &offset) < 0) {
75+
of_node_put(np);
7476
pr_err("failed to find smp-offset property\n");
7577
return;
7678
}
7779
ctrl_base += offset;
80+
of_node_put(np);
7881
}
7982
}
8083

@@ -160,6 +163,7 @@ static int hip01_boot_secondary(unsigned int cpu, struct task_struct *idle)
160163
if (WARN_ON(!node))
161164
return -1;
162165
ctrl_base = of_iomap(node, 0);
166+
of_node_put(node);
163167

164168
/* set the secondary core boot from DDR */
165169
remap_reg_value = readl_relaxed(ctrl_base + REG_SC_CTRL);

0 commit comments

Comments
 (0)