mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-02 09:36:42 +07:00
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>
This commit is contained in:
parent
322a8b0340
commit
971c90bfa2
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user