Skip to content

Commit 398539d

Browse files
TinyWindzzguoren83
authored andcommitted
csky: Don't leak device tree node reference
of_find_node_by_type() acquires a reference to the node returned by it and that reference needs to be dropped by its caller. setup_smp() doesn't do that, so fix it by converting to for_each_of_cpu_node(). Signed-off-by: Yangtao Li <tiny.windzz@gmail.com> Signed-off-by: Guo Ren <guoren@kernel.org>
1 parent 7566ec3 commit 398539d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/csky/kernel/smp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ void __init setup_smp(void)
138138
struct device_node *node = NULL;
139139
int cpu;
140140

141-
while ((node = of_find_node_by_type(node, "cpu"))) {
141+
for_each_of_cpu_node(node) {
142142
if (!of_device_is_available(node))
143143
continue;
144144

0 commit comments

Comments
 (0)