Skip to content

Commit

Permalink
[CPUFREQ] Check for not initialized freq on cpufreq changes
Browse files Browse the repository at this point in the history
Test for old_freq equals 0 to insure not to divide by 0:
______________________________________________

Check for not initialized freq on cpufreq changes

Signed-off-by: Thomas Renninger <trenn@suse.de>
Signed-off-by: Dave Jones <davej@redhat.com>
  • Loading branch information
Thomas Renninger authored and Dave Jones committed Feb 2, 2006
1 parent e4472cb commit 9d2725b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions arch/i386/kernel/timers/timer_tsc.c
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,10 @@ time_cpufreq_notifier(struct notifier_block *nb, unsigned long val,
if (val != CPUFREQ_RESUMECHANGE)
write_seqlock_irq(&xtime_lock);
if (!ref_freq) {
if (!freq->old){
ref_freq = freq->new;
goto end;
}
ref_freq = freq->old;
loops_per_jiffy_ref = cpu_data[freq->cpu].loops_per_jiffy;
#ifndef CONFIG_SMP
Expand All @@ -297,6 +301,7 @@ time_cpufreq_notifier(struct notifier_block *nb, unsigned long val,
#endif
}

end:
if (val != CPUFREQ_RESUMECHANGE)
write_sequnlock_irq(&xtime_lock);

Expand Down

0 comments on commit 9d2725b

Please sign in to comment.