openrisc: fix the fix of copy_from_user()
authorGuenter Roeck <linux@roeck-us.net>
Sat, 17 Sep 2016 19:57:24 +0000 (12:57 -0700)
committerGuenter Roeck <linux@roeck-us.net>
Sun, 18 Sep 2016 14:26:42 +0000 (07:26 -0700)
Since commit acb2505d0119 ("openrisc: fix copy_from_user()"),
copy_from_user() returns the number of bytes requested, not the
number of bytes not copied.

Cc: Al Viro <viro@zeniv.linux.org.uk>
Fixes: acb2505d0119 ("openrisc: fix copy_from_user()")
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
arch/openrisc/include/asm/uaccess.h

index cbad29b5a131c8e2cacf715f2122c5fd78382c79..5cc6b4f1b79516a7a5882886b59884d03529df6d 100644 (file)
@@ -276,7 +276,7 @@ copy_from_user(void *to, const void *from, unsigned long n)
        unsigned long res = n;
 
        if (likely(access_ok(VERIFY_READ, from, n)))
-               n = __copy_tofrom_user(to, from, n);
+               res = __copy_tofrom_user(to, from, n);
        if (unlikely(res))
                memset(to + (n - res), 0, res);
        return res;