FUTEX: Restore the dropped ERSCH fix

The return value of futex_find_get_task() needs to be -ESRCH in case
that the search fails. This was part of the original futex fixes and
got accidentally dropped, when the futex-tidy-up patch was split out.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Stable Team <stable@kernel.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by Thomas Gleixner and committed by Linus Torvalds a06381fe b2510b16

Changed files
+6 -8
kernel
+6 -8
kernel/futex.c
··· 409 409 410 410 rcu_read_lock(); 411 411 p = find_task_by_pid(pid); 412 - if (!p) 413 - goto out_unlock; 414 - if ((current->euid != p->euid) && (current->euid != p->uid)) { 415 - p = NULL; 416 - goto out_unlock; 417 - } 418 - get_task_struct(p); 419 - out_unlock: 412 + 413 + if (!p || ((current->euid != p->euid) && (current->euid != p->uid))) 414 + p = ERR_PTR(-ESRCH); 415 + else 416 + get_task_struct(p); 417 + 420 418 rcu_read_unlock(); 421 419 422 420 return p;