summaryrefslogtreecommitdiffstats
path: root/kernel
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 16:01:11 -0700
commit9e6776b6653afe1df9b362d4667a82070a1dd5f1 (patch)
tree8356f41e59c8f89461e2512c26e1565b4a44a5ab /kernel
parent9ba9ca73e6155efd4137e93796835b4377801893 (diff)
downloadkernel-crypto-9e6776b6653afe1df9b362d4667a82070a1dd5f1.tar.gz
kernel-crypto-9e6776b6653afe1df9b362d4667a82070a1dd5f1.tar.xz
kernel-crypto-9e6776b6653afe1df9b362d4667a82070a1dd5f1.zip
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')
-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 13700833c18..0e984977f28 100644
--- a/kernel/time/clocksource.c
+++ b/kernel/time/clocksource.c
@@ -580,6 +580,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;
/*