Skip to content

Commit f89f414

Browse files
hotranrafaeljw
authored andcommitted
cpufreq: CPPC: Avoid overflow when calculating desired_perf
This patch fixes overflow issue when calculating the desired_perf. Fixes: ad38677 (cpufreq: CPPC: Force reporting values in KHz to fix user space interface) Signed-off-by: Hoan Tran <hotran@apm.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent e01072d commit f89f414

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎drivers/cpufreq/cppc_cpufreq.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ static int cppc_cpufreq_set_target(struct cpufreq_policy *policy,
8484

8585
cpu = all_cpu_data[policy->cpu];
8686

87-
cpu->perf_ctrls.desired_perf = target_freq * policy->max / cppc_dmi_max_khz;
87+
cpu->perf_ctrls.desired_perf = (u64)target_freq * policy->max / cppc_dmi_max_khz;
8888
freqs.old = policy->cur;
8989
freqs.new = target_freq;
9090

0 commit comments

Comments
 (0)