diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2017-03-20 20:45:41 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2017-03-28 18:23:48 -0400 |
commit | 4df3715efe5ed1e77344c6d5dcbfd75017a2f8b5 (patch) | |
tree | 268a51f785a8b9cbd01254e9c9b6f2733bbe59d2 /arch/mn10300/lib | |
parent | 6c03905a63165921411fbe91c167186b13879c8d (diff) | |
download | linux-stable-4df3715efe5ed1e77344c6d5dcbfd75017a2f8b5.tar.gz linux-stable-4df3715efe5ed1e77344c6d5dcbfd75017a2f8b5.tar.bz2 linux-stable-4df3715efe5ed1e77344c6d5dcbfd75017a2f8b5.zip |
mn10300: get rid of zeroing
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'arch/mn10300/lib')
-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; } /* |