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:
 <CYYPR12MB8655D6D2630692790CCDEBE99CAD2@CYYPR12MB8655.namprd12.prod.outlook.com>
Date: Fri, 19 Jul 2024 06:38:30 +0000
From: "Yuan, Perry" <Perry.Yuan@....com>
To: Dan Carpenter <dan.carpenter@...aro.org>
CC: "Huang, Ray" <Ray.Huang@....com>, "Shenoy, Gautham Ranjal"
	<gautham.shenoy@....com>, "Limonciello, Mario" <Mario.Limonciello@....com>,
	"Rafael J. Wysocki" <rafael@...nel.org>, Viresh Kumar
	<viresh.kumar@...aro.org>, "linux-pm@...r.kernel.org"
	<linux-pm@...r.kernel.org>, "linux-kernel@...r.kernel.org"
	<linux-kernel@...r.kernel.org>, "kernel-janitors@...r.kernel.org"
	<kernel-janitors@...r.kernel.org>
Subject: RE: [PATCH] cpufreq: amd-pstate: Fix uninitialized variable in
 amd_pstate_cpu_boost_update()

[AMD Official Use Only - AMD Internal Distribution Only]

Hi Dan,

> -----Original Message-----
> From: Dan Carpenter <dan.carpenter@...aro.org>
> Sent: Friday, July 19, 2024 4:09 AM
> To: Yuan, Perry <Perry.Yuan@....com>
> Cc: Huang, Ray <Ray.Huang@....com>; Shenoy, Gautham Ranjal
> <gautham.shenoy@....com>; Limonciello, Mario
> <Mario.Limonciello@....com>; Yuan, Perry <Perry.Yuan@....com>; Rafael
> J. Wysocki <rafael@...nel.org>; Viresh Kumar <viresh.kumar@...aro.org>;
> linux-pm@...r.kernel.org; linux-kernel@...r.kernel.org; kernel-
> janitors@...r.kernel.org
> Subject: [PATCH] cpufreq: amd-pstate: Fix uninitialized variable in
> amd_pstate_cpu_boost_update()
>
> Smatch complains that "ret" could be uninitialized:
>
>   drivers/cpufreq/amd-pstate.c:734 amd_pstate_cpu_boost_update()
>   error: uninitialized symbol 'ret'.
>
> This seems like it probably is a real issue.  Initialize "ret" to zero to be safe.
>
> Fixes: c8c68c38b56f ("cpufreq: amd-pstate: initialize core precision boost
> state")
> Signed-off-by: Dan Carpenter <dan.carpenter@...aro.org>
> ---
>  drivers/cpufreq/amd-pstate.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c
> index 68c616b572f2..358bd88cd0c5 100644
> --- a/drivers/cpufreq/amd-pstate.c
> +++ b/drivers/cpufreq/amd-pstate.c
> @@ -692,7 +692,7 @@ static int amd_pstate_cpu_boost_update(struct
> cpufreq_policy *policy, bool on)
>       struct amd_cpudata *cpudata = policy->driver_data;
>       struct cppc_perf_ctrls perf_ctrls;
>       u32 highest_perf, nominal_perf, nominal_freq, max_freq;
> -     int ret;
> +     int ret = 0;
>
>       highest_perf = READ_ONCE(cpudata->highest_perf);
>       nominal_perf = READ_ONCE(cpudata->nominal_perf);
> --
> 2.43.0

Thanks for the fix.
LGTM
Reviewed-by: Perry Yuan <perry.yuan@....com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ