From: Dan Carpenter Date: Fri, 22 Feb 2013 00:41:57 +0000 (-0800) Subject: compat: return -EFAULT on error in waitid() X-Git-Tag: MMI-PSA29.97-13-9~14988^2~153 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=bffea77c08c361d174af7ad94887f6aecc3f340b;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git compat: return -EFAULT on error in waitid() The copy_to_user() call returns the number of bytes remaining but we want to return -EFAULT on error. Fixes "x32: fix waitid()" Signed-off-by: Dan Carpenter Cc: Al Viro Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/kernel/compat.c b/kernel/compat.c index 36700e9e2be9..f4bddb900186 100644 --- a/kernel/compat.c +++ b/kernel/compat.c @@ -593,7 +593,7 @@ COMPAT_SYSCALL_DEFINE5(waitid, else ret = put_compat_rusage(&ru, uru); if (ret) - return ret; + return -EFAULT; } BUG_ON(info.si_code & __SI_MASK);