From: Yangtao Li Date: Thu, 27 Dec 2018 17:45:51 +0000 (-0500) Subject: csky: Don't leak device tree node reference X-Git-Tag: v5.4-rc1~1865^2~18 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=398539dd69341f8e3b87b8fea9355c7edfb6d99a;p=platform%2Fkernel%2Flinux-rpi.git 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 Signed-off-by: Guo Ren --- diff --git a/arch/csky/kernel/smp.c b/arch/csky/kernel/smp.c index 36ebaf9..74d6273 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;