aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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,
479 if (!rtcdev) 479 if (!rtcdev)
480 return -ENOTSUPP; 480 return -ENOTSUPP;
481 481
482 /* Save old values */ 482 if (old_setting)
483 old_setting->it_interval = 483 alarm_timer_get(timr, old_setting);
484 ktime_to_timespec(timr->it.alarmtimer.period);
485 old_setting->it_value =
486 ktime_to_timespec(timr->it.alarmtimer.node.expires);
487 484
488 /* If the timer was already set, cancel it */ 485 /* If the timer was already set, cancel it */
489 alarm_cancel(&timr->it.alarmtimer); 486 alarm_cancel(&timr->it.alarmtimer);