diff options
author | Thomas Renninger <trenn@suse.de> | 2006-02-01 05:38:37 -0500 |
---|---|---|
committer | Dave Jones <davej@redhat.com> | 2006-02-02 16:51:44 -0500 |
commit | 9d2725bb815d915fc6c8531097d9e71b579a8763 (patch) | |
tree | 0183fb3860cef820a15b5f66ca5d574918c16640 /arch/i386 | |
parent | e4472cb3706ceea42797ae1dc79d624026986694 (diff) |
[CPUFREQ] Check for not initialized freq on cpufreq changes
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>
Diffstat (limited to 'arch/i386')
-rw-r--r-- | arch/i386/kernel/timers/timer_tsc.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/i386/kernel/timers/timer_tsc.c b/arch/i386/kernel/timers/timer_tsc.c index 47675bbbb316..591a642af884 100644 --- a/arch/i386/kernel/timers/timer_tsc.c +++ b/arch/i386/kernel/timers/timer_tsc.c | |||
@@ -272,6 +272,10 @@ time_cpufreq_notifier(struct notifier_block *nb, unsigned long val, | |||
272 | if (val != CPUFREQ_RESUMECHANGE) | 272 | if (val != CPUFREQ_RESUMECHANGE) |
273 | write_seqlock_irq(&xtime_lock); | 273 | write_seqlock_irq(&xtime_lock); |
274 | if (!ref_freq) { | 274 | if (!ref_freq) { |
275 | if (!freq->old){ | ||
276 | ref_freq = freq->new; | ||
277 | goto end; | ||
278 | } | ||
275 | ref_freq = freq->old; | 279 | ref_freq = freq->old; |
276 | loops_per_jiffy_ref = cpu_data[freq->cpu].loops_per_jiffy; | 280 | loops_per_jiffy_ref = cpu_data[freq->cpu].loops_per_jiffy; |
277 | #ifndef CONFIG_SMP | 281 | #ifndef CONFIG_SMP |
@@ -297,6 +301,7 @@ time_cpufreq_notifier(struct notifier_block *nb, unsigned long val, | |||
297 | #endif | 301 | #endif |
298 | } | 302 | } |
299 | 303 | ||
304 | end: | ||
300 | if (val != CPUFREQ_RESUMECHANGE) | 305 | if (val != CPUFREQ_RESUMECHANGE) |
301 | write_sequnlock_irq(&xtime_lock); | 306 | write_sequnlock_irq(&xtime_lock); |
302 | 307 | ||