Skip to content

Commit c019d92

Browse files
tititiou36stffrdhrn
authored andcommitted
openrisc: Fix a memory leak
'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: 9d02a42 ("OpenRISC: Boot code") Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Stafford Horne <shorne@gmail.com>
1 parent 9f4ad9e commit c019d92

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

arch/openrisc/kernel/setup.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,8 @@ void calibrate_delay(void)
278278
pr_cont("%lu.%02lu BogoMIPS (lpj=%lu)\n",
279279
loops_per_jiffy / (500000 / HZ),
280280
(loops_per_jiffy / (5000 / HZ)) % 100, loops_per_jiffy);
281+
282+
of_node_put(cpu);
281283
}
282284

283285
void __init setup_arch(char **cmdline_p)

0 commit comments

Comments
 (0)