aboutsummaryrefslogtreecommitdiff
path: root/kernel/time/clocksource.c
diff options
context:
space:
mode:
authorjohn stultz <johnstul@us.ibm.com>2010-03-01 12:34:43 -0800
committerGreg Kroah-Hartman <gregkh@suse.de>2010-04-01 15:58:06 -0700
commit74b176077272028d0a88eddd59e630abc37cd475 (patch)
tree397f2ac6276efc92f398359c8eab113f79a0d6e6 /kernel/time/clocksource.c
parentbc176c0d57c093240097fda93c8c6c3578eb5822 (diff)
timekeeping: Prevent oops when GENERIC_TIME=n
commit ad6759fbf35d104dbf573cd6f4c6784ad6823f7e upstream. 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> LKML-Reference: <1267475683.4216.61.camel@localhost.localdomain> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'kernel/time/clocksource.c')
-rw-r--r--kernel/time/clocksource.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c
index ecc7adbf091..f8b0f96110b 100644
--- a/kernel/time/clocksource.c
+++ b/kernel/time/clocksource.c
@@ -515,6 +515,10 @@ static inline void clocksource_select(void) { }
*/
static int __init clocksource_done_booting(void)
{
+ mutex_lock(&clocksource_mutex);
+ curr_clocksource = clocksource_default_clock();
+ mutex_unlock(&clocksource_mutex);
+
finished_booting = 1;
/*