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>] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 22 Dec 2022 09:12:21 +0000
From:   Tao Lan <taolan@...wei.com>
To:     <mturquette@...libre.com>, <sboyd@...nel.org>
CC:     <j.neuschaefer@....net>, <linux-clk@...r.kernel.org>,
        <linux-kernel@...r.kernel.org>, taolan <taolan@...wei.com>
Subject: [PATCH] clk: fix memory leak in hisi_clk_init.

From: taolan <taolan@...wei.com>

when clk_data create fail, we also need to release base.

Signed-off-by: taolan <taolan@...wei.com>
---
 drivers/clk/hisilicon/clk.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/clk/hisilicon/clk.c b/drivers/clk/hisilicon/clk.c
index 54d9fdc93599..9ca4fc05fa57 100644
--- a/drivers/clk/hisilicon/clk.c
+++ b/drivers/clk/hisilicon/clk.c
@@ -82,6 +82,10 @@ struct hisi_clock_data *hisi_clk_init(struct device_node *np,
 	of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data->clk_data);
 	return clk_data;
 err_data:
+	if (base) {
+		iounmap(base);
+		base = NULL;
+	}
 	kfree(clk_data);
 err:
 	return NULL;
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ