From f89f4147f76f91bfff6f32890fc34148178f144d Mon Sep 17 00:00:00 2001 From: Hoan Tran Date: Wed, 14 Sep 2016 16:08:28 -0700 Subject: [PATCH] cpufreq: CPPC: Avoid overflow when calculating desired_perf This patch fixes overflow issue when calculating the desired_perf. Fixes: ad38677df44b (cpufreq: CPPC: Force reporting values in KHz to fix user space interface) Signed-off-by: Hoan Tran Signed-off-by: Rafael J. Wysocki --- drivers/cpufreq/cppc_cpufreq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/cpufreq/cppc_cpufreq.c b/drivers/cpufreq/cppc_cpufreq.c index 6debc189a9c9..99db4227ae38 100644 --- a/drivers/cpufreq/cppc_cpufreq.c +++ b/drivers/cpufreq/cppc_cpufreq.c @@ -84,7 +84,7 @@ static int cppc_cpufreq_set_target(struct cpufreq_policy *policy, cpu = all_cpu_data[policy->cpu]; - cpu->perf_ctrls.desired_perf = target_freq * policy->max / cppc_dmi_max_khz; + cpu->perf_ctrls.desired_perf = (u64)target_freq * policy->max / cppc_dmi_max_khz; freqs.old = policy->cur; freqs.new = target_freq; -- 2.20.1