From: Dan Carpenter Date: Wed, 20 Feb 2013 02:13:32 +0000 (+1100) Subject: compat: return -EFAULT on error in waitid() X-Git-Tag: next-20130220~1^2~675 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=2bfe2dccde68387be27578fb188432d9eccd0025;p=karo-tx-linux.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 --- diff --git a/kernel/compat.c b/kernel/compat.c index de6f3244d325..19971d8c7299 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);