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: <20221122131536.GA157542@thinkpad>
Date:   Tue, 22 Nov 2022 18:45:36 +0530
From:   Manivannan Sadhasivam <mani@...nel.org>
To:     Xiu Jianfeng <xiujianfeng@...wei.com>
Cc:     agross@...nel.org, andersson@...nel.org, konrad.dybcio@...aro.org,
        rafael@...nel.org, viresh.kumar@...aro.org,
        linux-arm-msm@...r.kernel.org, linux-pm@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH -next] cpufreq: qcom-hw: Fix memory leak in
 qcom_cpufreq_hw_driver_probe()

On Tue, Nov 22, 2022 at 08:46:27PM +0800, Xiu Jianfeng wrote:
> If devm_clk_hw_register() fails, clk_init.name should be freed before
> return error, otherwise will cause memory leak issue, fix it.
> 
> Fixes: 84063a1cbe9e ("cpufreq: qcom-hw: Add CPU clock provider support")
> Signed-off-by: Xiu Jianfeng <xiujianfeng@...wei.com>

Reviewed-by: Manivannan Sadhasivam <mani@...nel.org>

Thanks,
Mani

> ---
>  drivers/cpufreq/qcom-cpufreq-hw.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/cpufreq/qcom-cpufreq-hw.c b/drivers/cpufreq/qcom-cpufreq-hw.c
> index 1bd1e9ae5308..340fed35e45d 100644
> --- a/drivers/cpufreq/qcom-cpufreq-hw.c
> +++ b/drivers/cpufreq/qcom-cpufreq-hw.c
> @@ -723,6 +723,7 @@ static int qcom_cpufreq_hw_driver_probe(struct platform_device *pdev)
>  		ret = devm_clk_hw_register(dev, &data->cpu_clk);
>  		if (ret < 0) {
>  			dev_err(dev, "Failed to register clock %d: %d\n", i, ret);
> +			kfree(clk_init.name);
>  			return ret;
>  		}
>  
> -- 
> 2.17.1
> 

-- 
மணிவண்ணன் சதாசிவம்

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ