diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2017-03-21 01:45:41 +0100 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2017-03-29 00:23:48 +0200 |
commit | 4df3715efe5ed1e77344c6d5dcbfd75017a2f8b5 (patch) | |
tree | 268a51f785a8b9cbd01254e9c9b6f2733bbe59d2 /arch/mn10300/lib/usercopy.c | |
parent | mn10300: switch to generic extable.h (diff) | |
download | linux-4df3715efe5ed1e77344c6d5dcbfd75017a2f8b5.tar.xz linux-4df3715efe5ed1e77344c6d5dcbfd75017a2f8b5.zip |
mn10300: get rid of zeroing
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'arch/mn10300/lib/usercopy.c')
-rw-r--r-- | arch/mn10300/lib/usercopy.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/arch/mn10300/lib/usercopy.c b/arch/mn10300/lib/usercopy.c index ce8899e5e171..b48af8d4f38d 100644 --- a/arch/mn10300/lib/usercopy.c +++ b/arch/mn10300/lib/usercopy.c @@ -22,11 +22,12 @@ __generic_copy_to_user(void *to, const void *from, unsigned long n) unsigned long __generic_copy_from_user(void *to, const void *from, unsigned long n) { - if (access_ok(VERIFY_READ, from, n)) - __copy_user_zeroing(to, from, n); - else - memset(to, 0, n); - return n; + unsigned long res = n; + if (access_ok(VERIFY_READ, from, res)) + __copy_user(to, from, res); + if (unlikely(res)) + memset(to + n - res, 0, res); + return res; } /* |