Skip to content

Commit

Permalink
openrisc: fix the fix of copy_from_user()
Browse files Browse the repository at this point in the history
Since commit acb2505 ("openrisc: fix copy_from_user()"),
copy_from_user() returns the number of bytes requested, not the
number of bytes not copied.

Cc: Al Viro <[email protected]>
Fixes: acb2505 ("openrisc: fix copy_from_user()")
Signed-off-by: Guenter Roeck <[email protected]>
  • Loading branch information
groeck committed Sep 18, 2016
1 parent 65c0044 commit 8e4b720
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/openrisc/include/asm/uaccess.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 8e4b720

Please sign in to comment.