summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2005-10-26 20:23:06 +0200
committerLinus Torvalds <torvalds@g5.osdl.org>2005-10-26 20:23:06 +0200
commit70ab81c2ed3d1323e7d6805bf59cbb570dff7937 (patch)
tree7679256f81780842aa443846f4cea7524c0db37a /kernel
parent[PATCH] fix radeon_cp_init_ring_buffer() (diff)
downloadlinux-70ab81c2ed3d1323e7d6805bf59cbb570dff7937.tar.xz
linux-70ab81c2ed3d1323e7d6805bf59cbb570dff7937.zip
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.c10
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)
listpos = head;
if (CPUCLOCK_WHICH(timer->it_clock) == CPUCLOCK_SCHED) {
list_for_each_entry(next, head, entry) {
- if (next->expires.sched > nt->expires.sched) {
- listpos = &next->entry;
+ if (next->expires.sched > nt->expires.sched)
break;
- }
+ listpos = &next->entry;
}
} else {
list_for_each_entry(next, head, entry) {
- if (cputime_gt(next->expires.cpu, nt->expires.cpu)) {
- listpos = &next->entry;
+ if (cputime_gt(next->expires.cpu, nt->expires.cpu))
break;
- }
+ listpos = &next->entry;
}
}
list_add(&nt->entry, listpos);