Skip to content

Commit

Permalink
alarmtimers: Fix time comparison
Browse files Browse the repository at this point in the history
commit c9c024b 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 <[email protected]>
Acked-by: John Stultz <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
KAGA-KOKO authored and gregkh committed Dec 21, 2011
1 parent 2a72a47 commit 612e5db
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/time/alarmtimer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 612e5db

Please sign in to comment.