summaryrefslogtreecommitdiffstats
path: root/arch/csky
diff options
context:
space:
mode:
authorYangtao Li <tiny.windzz@gmail.com>2018-12-27 12:45:51 -0500
committerGuo Ren <ren_guo@c-sky.com>2018-12-30 20:25:39 +0800
commit398539dd69341f8e3b87b8fea9355c7edfb6d99a (patch)
tree86716c20165a84a94c9e00b9cd23bb70dabf8185 /arch/csky
parent7566ec393f4161572ba6f11ad5171fd5d59b0fbd (diff)
downloadlinux-398539dd69341f8e3b87b8fea9355c7edfb6d99a.tar.gz
linux-398539dd69341f8e3b87b8fea9355c7edfb6d99a.tar.bz2
linux-398539dd69341f8e3b87b8fea9355c7edfb6d99a.zip
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>
Diffstat (limited to 'arch/csky')
-rw-r--r--arch/csky/kernel/smp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/csky/kernel/smp.c b/arch/csky/kernel/smp.c
index 36ebaf9834e1..74d627300c55 100644
--- a/arch/csky/kernel/smp.c
+++ b/arch/csky/kernel/smp.c
@@ -138,7 +138,7 @@ void __init setup_smp(void)
struct device_node *node = NULL;
int cpu;
- while ((node = of_find_node_by_type(node, "cpu"))) {
+ for_each_of_cpu_node(node) {
if (!of_device_is_available(node))
continue;