summaryrefslogtreecommitdiffstats
path: root/arch/m32r/lib
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2017-03-19 16:11:13 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2017-03-28 18:23:38 -0400
commit8cd920f26785ce42ec6fb807d40de67fc2eb41ce (patch)
tree8fed33da7a042733084eda32eb4d4c6e1663a61a /arch/m32r/lib
parent35f8acd5c660eb9dbf7a8379724821abb823a3d8 (diff)
downloadlinux-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.c9
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;
}