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 <[email protected]> Reviewed-by: Perry Yuan <[email protected]> Acked-by: Gautham R. Shenoy <[email protected]> Link: https://lore.kernel.org/lkml/[email protected]/T/ Signed-off-by: Gautham R. Shenoy <[email protected]> Signed-off-by: Mario Limonciello <[email protected]>
1 parent 47ac09b commit 67d9530

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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)