summaryrefslogtreecommitdiffstats
path: root/kernel/time
diff options
context:
space:
mode:
authorJohn Stultz <john.stultz@linaro.org>2011-08-04 16:25:35 +0200
committerJohn Stultz <john.stultz@linaro.org>2011-08-10 16:09:53 +0200
commit971c90bfa2f0b4fe52d6d9002178d547706f1343 (patch)
treef3075f495780a0ffc5d433ae7cb93aca8a40cf8e /kernel/time
parentLinux 3.1-rc1 (diff)
downloadlinux-971c90bfa2f0b4fe52d6d9002178d547706f1343.tar.xz
linux-971c90bfa2f0b4fe52d6d9002178d547706f1343.zip
alarmtimers: Avoid possible null pointer traversal
We don't check if old_setting is non null before assigning it, so correct this. CC: Thomas Gleixner <tglx@linutronix.de> CC: stable@kernel.org Signed-off-by: John Stultz <john.stultz@linaro.org>
Diffstat (limited to 'kernel/time')
-rw-r--r--kernel/time/alarmtimer.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/kernel/time/alarmtimer.c b/kernel/time/alarmtimer.c
index 59f369f98a04..1dee3f62a6a7 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);