diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2017-03-19 21:11:13 +0100 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2017-03-29 00:23:38 +0200 |
commit | 8cd920f26785ce42ec6fb807d40de67fc2eb41ce (patch) | |
tree | 8fed33da7a042733084eda32eb4d4c6e1663a61a /arch/m32r/lib | |
parent | m32r: switch to generic extable.h (diff) | |
download | linux-8cd920f26785ce42ec6fb807d40de67fc2eb41ce.tar.xz linux-8cd920f26785ce42ec6fb807d40de67fc2eb41ce.zip |
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; } |