diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2016-09-10 22:21:34 +0200 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2016-09-16 01:51:54 +0200 |
commit | 085354f907969fb3ee33f236368f6e1dd4c74d62 (patch) | |
tree | 26f51f89198a993dff1c7ef7245ad3e8d0d8c327 /arch/alpha/include | |
parent | avr32: fix copy_from_user() (diff) | |
download | linux-085354f907969fb3ee33f236368f6e1dd4c74d62.tar.xz linux-085354f907969fb3ee33f236368f6e1dd4c74d62.zip |
alpha: get rid of tail-zeroing in __copy_user()
... and adjust copy_from_user() accordingly
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'arch/alpha/include')
-rw-r--r-- | arch/alpha/include/asm/uaccess.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/arch/alpha/include/asm/uaccess.h b/arch/alpha/include/asm/uaccess.h index 466e42e96bfa..94f587535dee 100644 --- a/arch/alpha/include/asm/uaccess.h +++ b/arch/alpha/include/asm/uaccess.h @@ -396,11 +396,12 @@ copy_to_user(void __user *to, const void *from, long n) extern inline long copy_from_user(void *to, const void __user *from, long n) { + long res = n; if (likely(__access_ok((unsigned long)from, n, get_fs()))) - n = __copy_tofrom_user_nocheck(to, (__force void *)from, n); - else - memset(to, 0, n); - return n; + res = __copy_from_user_inatomic(to, from, n); + if (unlikely(res)) + memset(to + (n - res), 0, res); + return res; } extern void __do_clear_user(void); |