Skip to content

Commit

Permalink
[CPUFREQ] powernow-k8: Don't try to transition if the pstate is incor…
Browse files Browse the repository at this point in the history
…rect

This patch augments the pstate transition code to error out
(instead of returning 0) when an incorrect pstate is provided.

Suggested-by: Borislav Petkov <[email protected]>
CC: [email protected]
CC: [email protected]
Signed-off-by: Konrad Rzeszutek Wilk <[email protected]>
Signed-off-by: Dave Jones <[email protected]>
  • Loading branch information
konradwilk authored and Dave Jones committed Jun 16, 2011
1 parent a9d3d20 commit fbb5b89
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/cpufreq/powernow-k8.c
Original file line number Diff line number Diff line change
Expand Up @@ -1104,7 +1104,8 @@ static int transition_frequency_pstate(struct powernow_k8_data *data,
/* get MSR index for hardware pstate transition */
pstate = index & HW_PSTATE_MASK;
if (pstate > data->max_hw_pstate)
return 0;
return -EINVAL;

freqs.old = find_khz_freq_from_pstate(data->powernow_table,
data->currpstate);
freqs.new = find_khz_freq_from_pstate(data->powernow_table, pstate);
Expand Down

0 comments on commit fbb5b89

Please sign in to comment.