From: Thomas Renninger Date: Wed, 1 Feb 2006 10:38:37 +0000 (+0100) Subject: [CPUFREQ] Check for not initialized freq on cpufreq changes X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=9d2725bb815d915fc6c8531097d9e71b579a8763;p=linux-beck.git [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 Signed-off-by: Dave Jones --- 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, 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);