Skip to content

Commit

Permalink
alarmtimers: Fix time comparison
Browse files Browse the repository at this point in the history
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]>
Cc: [email protected]
  • Loading branch information
KAGA-KOKO committed Dec 6, 2011
1 parent d68fb11 commit c9c024b
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 @@ -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);
Expand Down

0 comments on commit c9c024b

Please sign in to comment.