Skip to content

Commit

Permalink
[PATCH] pi-futex: futex_wake() lockup fix
Browse files Browse the repository at this point in the history
Fix futex_wake() exit condition bug when handling the robust-list with PI
futexes on them.

(reported by Ulrich Drepper, debugged by the lock validator.)

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Cc: Ulrich Drepper <drepper@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Ingo Molnar authored and Linus Torvalds committed Jul 1, 2006
1 parent a99e4e4 commit ed6f7b1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions kernel/futex.c
Original file line number Diff line number Diff line change
Expand Up @@ -630,8 +630,10 @@ static int futex_wake(u32 __user *uaddr, int nr_wake)

list_for_each_entry_safe(this, next, head, list) {
if (match_futex (&this->key, &key)) {
if (this->pi_state)
return -EINVAL;
if (this->pi_state) {
ret = -EINVAL;
break;
}
wake_futex(this);
if (++ret >= nr_wake)
break;
Expand Down

0 comments on commit ed6f7b1

Please sign in to comment.