diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2016-08-20 16:39:01 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-09-24 10:07:44 +0200 |
commit | ba45b3ff27474fd540d6efa66c62f7d53c17b073 (patch) | |
tree | 59def0de6846793db5db1b75942733b7ae3cab74 | |
parent | 9ce4d2bd802d99a39b424408c9633dac047c0b32 (diff) |
nios2: fix __get_user()
commit 2e29f50ad5e23db37dde9be71410d95d50241ecd upstream.
a) should not leave crap on fault
b) should _not_ require access_ok() in any cases.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | arch/nios2/include/asm/uaccess.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/nios2/include/asm/uaccess.h b/arch/nios2/include/asm/uaccess.h index caa51ff85a3c..ebac5bbfc340 100644 --- a/arch/nios2/include/asm/uaccess.h +++ b/arch/nios2/include/asm/uaccess.h @@ -139,7 +139,7 @@ extern long strnlen_user(const char __user *s, long n); #define __get_user_unknown(val, size, ptr, err) do { \ err = 0; \ - if (copy_from_user(&(val), ptr, size)) { \ + if (__copy_from_user(&(val), ptr, size)) { \ err = -EFAULT; \ } \ } while (0) @@ -166,7 +166,7 @@ do { \ ({ \ long __gu_err = -EFAULT; \ const __typeof__(*(ptr)) __user *__gu_ptr = (ptr); \ - unsigned long __gu_val; \ + unsigned long __gu_val = 0; \ __get_user_common(__gu_val, sizeof(*(ptr)), __gu_ptr, __gu_err);\ (x) = (__force __typeof__(x))__gu_val; \ __gu_err; \ |