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-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <000001d8fef0$79cb1c70$6d615550$@samsung.com>
Date:   Wed, 23 Nov 2022 09:32:56 +0530
From:   "Alim Akhtar" <alim.akhtar@...sung.com>
To:     "'Xiu Jianfeng'" <xiujianfeng@...wei.com>,
        <krzysztof.kozlowski@...aro.org>, <s.nawrocki@...sung.com>,
        <tomasz.figa@...il.com>, <cw00.choi@...sung.com>,
        <mturquette@...libre.com>, <sboyd@...nel.org>,
        <dianders@...omium.org>, <yadi.brar@...sung.com>,
        <mturquette@...aro.org>
Cc:     <linux-samsung-soc@...r.kernel.org>, <linux-clk@...r.kernel.org>,
        <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH] clk: samsung: Fix memory leak in
 _samsung_clk_register_pll()

Hi Xiu

>-----Original Message-----
>From: Xiu Jianfeng [mailto:xiujianfeng@...wei.com]
>Sent: Wednesday, November 23, 2022 8:50 AM
>To: krzysztof.kozlowski@...aro.org; s.nawrocki@...sung.com;
>tomasz.figa@...il.com; cw00.choi@...sung.com;
>alim.akhtar@...sung.com; mturquette@...libre.com; sboyd@...nel.org;
>dianders@...omium.org; yadi.brar@...sung.com; mturquette@...aro.org
>Cc: linux-samsung-soc@...r.kernel.org; linux-clk@...r.kernel.org; linux-
>kernel@...r.kernel.org
>Subject: [PATCH] clk: samsung: Fix memory leak in
>_samsung_clk_register_pll()
>
>If clk_register() fails, @pll->rate_table may have allocated memory by
>kmemdup(), so it needs to be freed, otherwise will cause memory leak issue,
>this patch fixes it.
>
>Fixes: 3ff6e0d8d64d ("clk: samsung: Add support to register rate_table for
>samsung plls")
>Signed-off-by: Xiu Jianfeng <xiujianfeng@...wei.com>
>---
Thanks!

Reviewed-by: Alim Akhtar <alim.akhtar@...sung.com>

> drivers/clk/samsung/clk-pll.c | 1 +
> 1 file changed, 1 insertion(+)
>
>diff --git a/drivers/clk/samsung/clk-pll.c b/drivers/clk/samsung/clk-pll.c
index
>fe383471c5f0..0ff28938943f 100644
>--- a/drivers/clk/samsung/clk-pll.c
>+++ b/drivers/clk/samsung/clk-pll.c
>@@ -1583,6 +1583,7 @@ static void __init _samsung_clk_register_pll(struct
>samsung_clk_provider *ctx,
> 	if (ret) {
> 		pr_err("%s: failed to register pll clock %s : %d\n",
> 			__func__, pll_clk->name, ret);
>+		kfree(pll->rate_table);
> 		kfree(pll);
> 		return;
> 	}
>--
>2.17.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ