summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>2021-04-23 17:09:28 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-05-26 11:46:58 +0200
commite25a6946d8eb5d84a2f70c91605181ea71b79966 (patch)
treec30df26df225944afd16231a5207f65c6aa24387
parent96afcb20f36f07683aaa342e592ea8ec76fd1fa6 (diff)
downloadlinux-e25a6946d8eb5d84a2f70c91605181ea71b79966.tar.gz
linux-e25a6946d8eb5d84a2f70c91605181ea71b79966.tar.bz2
linux-e25a6946d8eb5d84a2f70c91605181ea71b79966.zip
openrisc: Fix a memory leak
[ Upstream commit c019d92457826bb7b2091c86f36adb5de08405f9 ] 'setup_find_cpu_node()' take a reference on the node it returns. This reference must be decremented when not needed anymore, or there will be a leak. Add the missing 'of_node_put(cpu)'. Note that 'setup_cpuinfo()' that also calls this function already has a correct 'of_node_put(cpu)' at its end. Fixes: 9d02a4283e9c ("OpenRISC: Boot code") Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Stafford Horne <shorne@gmail.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--arch/openrisc/kernel/setup.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/openrisc/kernel/setup.c b/arch/openrisc/kernel/setup.c
index dbf5ee95a0d5..b29aa3237e76 100644
--- a/arch/openrisc/kernel/setup.c
+++ b/arch/openrisc/kernel/setup.c
@@ -260,6 +260,8 @@ void calibrate_delay(void)
pr_cont("%lu.%02lu BogoMIPS (lpj=%lu)\n",
loops_per_jiffy / (500000 / HZ),
(loops_per_jiffy / (5000 / HZ)) % 100, loops_per_jiffy);
+
+ of_node_put(cpu);
}
void __init setup_arch(char **cmdline_p)