timekeeping: Prevent oops when GENERIC_TIME=n
authorjohn stultz <johnstul@us.ibm.com>
Mon, 1 Mar 2010 20:34:43 +0000 (12:34 -0800)
committerThomas Gleixner <tglx@linutronix.de>
Tue, 2 Mar 2010 08:22:25 +0000 (09:22 +0100)
commitad6759fbf35d104dbf573cd6f4c6784ad6823f7e
tree6eb4b1770d8875828c9693cdd510f43fb87da8b6
parent13dda80e48439b446d0bc9bab34b91484bc8f533
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>
kernel/time/clocksource.c