diff options
author | John Stultz <john.stultz@linaro.org> | 2011-08-04 07:25:35 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-10-03 11:40:06 -0700 |
commit | 26cf1a7ba1a6cc19d48c993bebd3be94c48af74a (patch) | |
tree | d58851c18bab62e7ce380ca8c32fa2b515149599 /kernel/time | |
parent | 5607cbd164dc1913cc52abba893c0961617eafd2 (diff) | |
download | kernel_samsung_crespo-26cf1a7ba1a6cc19d48c993bebd3be94c48af74a.zip kernel_samsung_crespo-26cf1a7ba1a6cc19d48c993bebd3be94c48af74a.tar.gz kernel_samsung_crespo-26cf1a7ba1a6cc19d48c993bebd3be94c48af74a.tar.bz2 |
alarmtimers: Avoid possible null pointer traversal
commit 971c90bfa2f0b4fe52d6d9002178d547706f1343 upstream.
We don't check if old_setting is non null before assigning it, so
correct this.
CC: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'kernel/time')
-rw-r--r-- | kernel/time/alarmtimer.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/kernel/time/alarmtimer.c b/kernel/time/alarmtimer.c index 59f369f..1dee3f6 100644 --- a/kernel/time/alarmtimer.c +++ b/kernel/time/alarmtimer.c @@ -479,11 +479,8 @@ static int alarm_timer_set(struct k_itimer *timr, int flags, if (!rtcdev) return -ENOTSUPP; - /* Save old values */ - old_setting->it_interval = - ktime_to_timespec(timr->it.alarmtimer.period); - old_setting->it_value = - ktime_to_timespec(timr->it.alarmtimer.node.expires); + if (old_setting) + alarm_timer_get(timr, old_setting); /* If the timer was already set, cancel it */ alarm_cancel(&timr->it.alarmtimer); |