summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-12-21 19:51:54 +0100
committerLinus Torvalds <torvalds@linux-foundation.org>2018-12-21 19:51:54 +0100
commite572fa0e840154d33a69622af030dda551eee606 (patch)
treef1f5e6a1dc5dfad90cc82071af14c1529bd519aa /kernel
parentMerge branch 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux... (diff)
parentposix-timers: Fix division by zero bug (diff)
downloadlinux-e572fa0e840154d33a69622af030dda551eee606.tar.xz
linux-e572fa0e840154d33a69622af030dda551eee606.zip
Merge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull timer fix from Ingo Molnar: "Fix a division by zero crash in the posix-timers code" * 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: posix-timers: Fix division by zero bug
Diffstat (limited to 'kernel')
-rw-r--r--kernel/time/posix-timers.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/kernel/time/posix-timers.c b/kernel/time/posix-timers.c
index bd62b5eeb5a0..31f49ae80f43 100644
--- a/kernel/time/posix-timers.c
+++ b/kernel/time/posix-timers.c
@@ -289,9 +289,6 @@ static void common_hrtimer_rearm(struct k_itimer *timr)
{
struct hrtimer *timer = &timr->it.real.timer;
- if (!timr->it_interval)
- return;
-
timr->it_overrun += hrtimer_forward(timer, timer->base->get_time(),
timr->it_interval);
hrtimer_restart(timer);
@@ -317,7 +314,7 @@ void posixtimer_rearm(struct kernel_siginfo *info)
if (!timr)
return;
- if (timr->it_requeue_pending == info->si_sys_private) {
+ if (timr->it_interval && timr->it_requeue_pending == info->si_sys_private) {
timr->kclock->timer_rearm(timr);
timr->it_active = 1;