From ed6f7b10e657b98b4ba89385d02852c8bdf3980e Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Sat, 1 Jul 2006 04:35:46 -0700 Subject: [PATCH] pi-futex: futex_wake() lockup fix 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 Cc: Ulrich Drepper Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- kernel/futex.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'kernel') diff --git a/kernel/futex.c b/kernel/futex.c index 22aa3c16ca73..15caf93e4a43 100644 --- a/kernel/futex.c +++ b/kernel/futex.c @@ -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; -- cgit v1.2.3