diff options
author | Hoan Tran | 2016-09-14 16:08:28 -0700 |
---|---|---|
committer | Rafael J. Wysocki | 2016-09-16 23:59:19 +0200 |
commit | f89f4147f76f91bfff6f32890fc34148178f144d (patch) | |
tree | 24b79bb78cb49335c3060f200b69b96a044ab150 /drivers | |
parent | e01072d22d4e7f9ca966f848def22fe41eaef4de (diff) |
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 <hotran@apm.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/cpufreq/cppc_cpufreq.c | 2 |
1 files changed, 1 insertions, 1 deletions
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; |