cpufreq: interactive: Fix potential division by zero
This commit is contained in:
parent
c69e698fff
commit
c8cec4c0c1
@ -171,6 +171,9 @@ static unsigned int cpufreq_interactive_calc_freq(unsigned int cpu)
|
||||
idle_time = (unsigned int) current_idle_time - freq_change_time_in_idle;
|
||||
delta_time = (unsigned int) current_wall_time - freq_change_time;
|
||||
|
||||
if (delta_time == 0)
|
||||
return policy->cur;
|
||||
|
||||
cpu_load = 100 * (delta_time - idle_time) / delta_time;
|
||||
|
||||
return policy->cur * cpu_load / 100;
|
||||
|
Loading…
Reference in New Issue
Block a user