arch: arc: Fix memory leak in show_cpuinfo()
PATCH 1/1 arch: arc: Fix memory leak in show_cpuinfo()
The "cpu_clk" resource is malloced by clk_get(),
it is not released when the function return.
Fixes 7f35144cea21 ("ARC: get rate from clk driver instead of reading device tree")
Signed-off-by Chen Hui <[email protected]>
--- arch/arc/kernel/setup.c | 1 + 1 file changed, 1 insertion(+)
arch/arc/kernel/setup.c +1 -0
@@ -637,6 +637,7 @@ static int show_cpuinfo(struct seq_file *m, void *v) cpu_id); }else { freq =clk_get_rate (cpu_clk); +clk_put (cpu_clk); }if (freq) seq_printf(m, "CPU speed\t: %lu.%02lu Mhz\n",
Signature · 1 line
2.17.1