diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2017-03-19 16:11:13 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2017-03-28 18:23:38 -0400 |
commit | 8cd920f26785ce42ec6fb807d40de67fc2eb41ce (patch) | |
tree | 8fed33da7a042733084eda32eb4d4c6e1663a61a /arch/m32r/lib | |
parent | 35f8acd5c660eb9dbf7a8379724821abb823a3d8 (diff) | |
download | linux-8cd920f26785ce42ec6fb807d40de67fc2eb41ce.tar.bz2 |
m32r: get rid of zeroing
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'arch/m32r/lib')
-rw-r--r-- | arch/m32r/lib/usercopy.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/arch/m32r/lib/usercopy.c b/arch/m32r/lib/usercopy.c index fd03f2731f20..6aacf5ba0a58 100644 --- a/arch/m32r/lib/usercopy.c +++ b/arch/m32r/lib/usercopy.c @@ -23,12 +23,13 @@ __generic_copy_to_user(void __user *to, const void *from, unsigned long n) unsigned long __generic_copy_from_user(void *to, const void __user *from, unsigned long n) { + unsigned long ret = n; prefetchw(to); if (access_ok(VERIFY_READ, from, n)) - __copy_user_zeroing(to,from,n); - else - memset(to, 0, n); - return n; + ret = __copy_user(to,from,n); + if (unlikely(ret)) + memset(to + n - ret, 0, ret); + return ret; } |