diff options
author | John Stultz <john.stultz@linaro.org> | 2011-06-02 01:18:09 (GMT) |
---|---|---|
committer | John Stultz <john.stultz@linaro.org> | 2011-06-21 23:55:36 (GMT) |
commit | cb5de2f8d0306be38f9b377b8a5c56acca7dbc3d (patch) | |
tree | 9edd5bd1fd1e41be44026a37b2184200f6f90d50 /kernel/time/timekeeping.c | |
parent | e08f6d4131ab964420f0bcabecc68d75fb49df79 (diff) | |
download | linux-fsl-qoriq-cb5de2f8d0306be38f9b377b8a5c56acca7dbc3d.tar.xz |
time: Catch invalid timespec sleep values in __timekeeping_inject_sleeptime
Arve suggested making sure we catch possible negative sleep time
intervals that could be passed into timekeeping_inject_sleeptime.
CC: Arve Hjønnevåg <arve@android.com>
CC: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Diffstat (limited to 'kernel/time/timekeeping.c')
-rw-r--r-- | kernel/time/timekeeping.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c index 342408c..9d09777 100644 --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c @@ -604,6 +604,12 @@ static struct timespec timekeeping_suspend_time; */ static void __timekeeping_inject_sleeptime(struct timespec *delta) { + if (!timespec_valid(delta)) { + printk(KERN_WARN "__timekeeping_inject_sleeptime: Invalid " + "sleep delta value!\n"); + return; + } + xtime = timespec_add(xtime, *delta); wall_to_monotonic = timespec_sub(wall_to_monotonic, *delta); total_sleep_time = timespec_add(total_sleep_time, *delta); |