diff options
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; } |