diff options
author | Thomas Renninger <trenn@suse.de> | 2006-02-01 11:38:37 +0100 |
---|---|---|
committer | Dave Jones <davej@redhat.com> | 2006-02-02 16:51:44 -0500 |
commit | 9d2725bb815d915fc6c8531097d9e71b579a8763 (patch) | |
tree | 0183fb3860cef820a15b5f66ca5d574918c16640 /arch | |
parent | e4472cb3706ceea42797ae1dc79d624026986694 (diff) | |
download | op-kernel-dev-9d2725bb815d915fc6c8531097d9e71b579a8763.zip op-kernel-dev-9d2725bb815d915fc6c8531097d9e71b579a8763.tar.gz |
[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')
-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 47675bb..591a642 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, 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 @@ -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); |