Commit 971c90bf authored by John Stultz's avatar John Stultz

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: default avatarJohn Stultz <john.stultz@linaro.org>
parent 322a8b03
...@@ -479,11 +479,8 @@ static int alarm_timer_set(struct k_itimer *timr, int flags, ...@@ -479,11 +479,8 @@ static int alarm_timer_set(struct k_itimer *timr, int flags,
if (!rtcdev) if (!rtcdev)
return -ENOTSUPP; return -ENOTSUPP;
/* Save old values */ if (old_setting)
old_setting->it_interval = alarm_timer_get(timr, old_setting);
ktime_to_timespec(timr->it.alarmtimer.period);
old_setting->it_value =
ktime_to_timespec(timr->it.alarmtimer.node.expires);
/* If the timer was already set, cancel it */ /* If the timer was already set, cancel it */
alarm_cancel(&timr->it.alarmtimer); alarm_cancel(&timr->it.alarmtimer);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment