futex: correctly return -EFAULT not -EINVAL
authorThomas Gleixner <tglx@linutronix.de>
Wed, 5 Dec 2007 14:46:09 +0000 (15:46 +0100)
committerIngo Molnar <mingo@elte.hu>
Wed, 5 Dec 2007 14:46:09 +0000 (15:46 +0100)
return -EFAULT not -EINVAL. Found by review.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
kernel/futex.c

index e8fbdd7..172a1ae 100644 (file)
@@ -658,7 +658,7 @@ static int wake_futex_pi(u32 __user *uaddr, u32 uval, struct futex_q *this)
 
                if (curval == -EFAULT)
                        ret = -EFAULT;
-               if (curval != uval)
+               else if (curval != uval)
                        ret = -EINVAL;
                if (ret) {
                        spin_unlock(&pi_state->pi_mutex.wait_lock);