lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:   Tue, 8 Nov 2022 22:12:41 +0800
From:   Chen Hui <judy.chenhui@...wei.com>
To:     <vgupta@...nel.org>, <Vladislav.Zakharov@...opsys.com>
CC:     <linux-snps-arc@...ts.infradead.org>,
        <linux-kernel@...r.kernel.org>, <judy.chenhui@...wei.com>
Subject: [PATCH] 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 <judy.chenhui@...wei.com>
---
 arch/arc/kernel/setup.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arc/kernel/setup.c b/arch/arc/kernel/setup.c
index 41f07b3e594e..9457c7ad8707 100644
--- a/arch/arc/kernel/setup.c
+++ b/arch/arc/kernel/setup.c
@@ -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",
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ