]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
compat: return -EFAULT on error in waitid()
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 20 Feb 2013 02:13:32 +0000 (13:13 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 20 Feb 2013 05:52:02 +0000 (16:52 +1100)
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 <dan.carpenter@oracle.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
kernel/compat.c

index de6f3244d32550751b1bfe987cba1980664e3963..19971d8c72993af7f322767df7f21bdc33fd36bb 100644 (file)
@@ -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);