diff options
author | john stultz <johnstul@us.ibm.com> | 2010-03-01 15:34:43 -0500 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2010-03-02 03:22:25 -0500 |
commit | ad6759fbf35d104dbf573cd6f4c6784ad6823f7e (patch) | |
tree | 6eb4b1770d8875828c9693cdd510f43fb87da8b6 | |
parent | 13dda80e48439b446d0bc9bab34b91484bc8f533 (diff) |
timekeeping: Prevent oops when GENERIC_TIME=n
Aaro Koskinen reported an issue in kernel.org bugzilla #15366, where
on non-GENERIC_TIME systems, accessing
/sys/devices/system/clocksource/clocksource0/current_clocksource
results in an oops.
It seems the timekeeper/clocksource rework missed initializing the
curr_clocksource value in the !GENERIC_TIME case.
Thanks to Aaro for reporting and diagnosing the issue as well as
testing the fix!
Reported-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: John Stultz <johnstul@us.ibm.com>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: stable@kernel.org
LKML-Reference: <1267475683.4216.61.camel@localhost.localdomain>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r-- | kernel/time/clocksource.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c index 1f663d23e85e..1f5dde637457 100644 --- a/kernel/time/clocksource.c +++ b/kernel/time/clocksource.c | |||
@@ -592,6 +592,10 @@ static inline void clocksource_select(void) { } | |||
592 | */ | 592 | */ |
593 | static int __init clocksource_done_booting(void) | 593 | static int __init clocksource_done_booting(void) |
594 | { | 594 | { |
595 | mutex_lock(&clocksource_mutex); | ||
596 | curr_clocksource = clocksource_default_clock(); | ||
597 | mutex_unlock(&clocksource_mutex); | ||
598 | |||
595 | finished_booting = 1; | 599 | finished_booting = 1; |
596 | 600 | ||
597 | /* | 601 | /* |