diff options
| author | Linus Torvalds <torvalds@g5.osdl.org> | 2005-10-26 14:23:06 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-10-26 14:23:06 -0400 |
| commit | 70ab81c2ed3d1323e7d6805bf59cbb570dff7937 (patch) | |
| tree | 7679256f81780842aa443846f4cea7524c0db37a /kernel | |
| parent | b0917bd912d3708c50e1df1b5e1648d0547108a3 (diff) | |
posix cpu timers: fix timer ordering
Pointed out by Oleg Nesterov, who has been walking over the code
forwards and backwards.
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/posix-cpu-timers.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/kernel/posix-cpu-timers.c b/kernel/posix-cpu-timers.c index b15462b17a58..2f86424fa515 100644 --- a/kernel/posix-cpu-timers.c +++ b/kernel/posix-cpu-timers.c | |||
| @@ -576,17 +576,15 @@ static void arm_timer(struct k_itimer *timer, union cpu_time_count now) | |||
| 576 | listpos = head; | 576 | listpos = head; |
| 577 | if (CPUCLOCK_WHICH(timer->it_clock) == CPUCLOCK_SCHED) { | 577 | if (CPUCLOCK_WHICH(timer->it_clock) == CPUCLOCK_SCHED) { |
| 578 | list_for_each_entry(next, head, entry) { | 578 | list_for_each_entry(next, head, entry) { |
| 579 | if (next->expires.sched > nt->expires.sched) { | 579 | if (next->expires.sched > nt->expires.sched) |
| 580 | listpos = &next->entry; | ||
| 581 | break; | 580 | break; |
| 582 | } | 581 | listpos = &next->entry; |
| 583 | } | 582 | } |
| 584 | } else { | 583 | } else { |
| 585 | list_for_each_entry(next, head, entry) { | 584 | list_for_each_entry(next, head, entry) { |
| 586 | if (cputime_gt(next->expires.cpu, nt->expires.cpu)) { | 585 | if (cputime_gt(next->expires.cpu, nt->expires.cpu)) |
| 587 | listpos = &next->entry; | ||
| 588 | break; | 586 | break; |
| 589 | } | 587 | listpos = &next->entry; |
| 590 | } | 588 | } |
| 591 | } | 589 | } |
| 592 | list_add(&nt->entry, listpos); | 590 | list_add(&nt->entry, listpos); |
