]> git.baikalelectronics.ru Git - kernel.git/commitdiff
alarmtimers: Fix time comparison
authorThomas Gleixner <tglx@linutronix.de>
Mon, 5 Dec 2011 20:20:23 +0000 (21:20 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Tue, 6 Dec 2011 10:38:32 +0000 (11:38 +0100)
The expiry function compares the timer against current time and does
not expire the timer when the expiry time is >= now. That's wrong. If
the timer is set for now, then it must expire.

Make the condition expiry > now for breaking out the loop.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: John Stultz <john.stultz@linaro.org>
Cc: stable@kernel.org
kernel/time/alarmtimer.c

index c436e790b21bf7cd89878eb9d92146e1b1c511d6..8a46f5d64504f15dcaf31ec4f5fcee7ea15a8bdf 100644 (file)
@@ -195,7 +195,7 @@ static enum hrtimer_restart alarmtimer_fired(struct hrtimer *timer)
                struct alarm *alarm;
                ktime_t expired = next->expires;
 
-               if (expired.tv64 >= now.tv64)
+               if (expired.tv64 > now.tv64)
                        break;
 
                alarm = container_of(next, struct alarm, node);