Skip to content

Commit 67d9530

Browse files
Dan Carpentersuperm1
authored andcommitted
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: c8c68c3 ("cpufreq: amd-pstate: initialize core precision boost state") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Perry Yuan <perry.yuan@amd.com> Acked-by: Gautham R. Shenoy <gautham.shenoy@amd.com> Link: https://lore.kernel.org/lkml/7ff53543-6c04-48a0-8d99-7dc010b93b3a@stanley.mountain/T/ Signed-off-by: Gautham R. Shenoy <gautham.shenoy@amd.com> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
1 parent 47ac09b commit 67d9530

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/cpufreq/amd-pstate.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,7 @@ static int amd_pstate_cpu_boost_update(struct cpufreq_policy *policy, bool on)
692692
struct amd_cpudata *cpudata = policy->driver_data;
693693
struct cppc_perf_ctrls perf_ctrls;
694694
u32 highest_perf, nominal_perf, nominal_freq, max_freq;
695-
int ret;
695+
int ret = 0;
696696

697697
highest_perf = READ_ONCE(cpudata->highest_perf);
698698
nominal_perf = READ_ONCE(cpudata->nominal_perf);

0 commit comments

Comments
 (0)