diff --git a/kernel/futex.c b/kernel/futex.c index 22aa3c16ca73edc46242f72ad7f49ea14c8ea983..15caf93e4a4379df3d1072bb82d286cb70a06a80 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;