alarmtimers: Fix time comparison
authorThomas Gleixner <tglx@linutronix.de>
Mon, 5 Dec 2011 20:20:23 +0000 (21:20 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 21 Dec 2011 20:57:34 +0000 (12:57 -0800)
commit c9c024b3f3e07d087974db4c0dc46217fff3a6c0 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
kernel/time/alarmtimer.c

index ea5e1a928d5b08c04321ab1b39a87c486118b1d2..8b70c76910aa76d1b350a31f2687abf87361776e 100644 (file)
@@ -181,7 +181,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);