Skip to content

Commit 2e29f50

Browse files
author
Al Viro
committed
nios2: fix __get_user()
a) should not leave crap on fault b) should _not_ require access_ok() in any cases. Cc: [email protected] Signed-off-by: Al Viro <[email protected]>
1 parent e33d1f6 commit 2e29f50

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/nios2/include/asm/uaccess.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ extern long strnlen_user(const char __user *s, long n);
142142

143143
#define __get_user_unknown(val, size, ptr, err) do { \
144144
err = 0; \
145-
if (copy_from_user(&(val), ptr, size)) { \
145+
if (__copy_from_user(&(val), ptr, size)) { \
146146
err = -EFAULT; \
147147
} \
148148
} while (0)
@@ -169,7 +169,7 @@ do { \
169169
({ \
170170
long __gu_err = -EFAULT; \
171171
const __typeof__(*(ptr)) __user *__gu_ptr = (ptr); \
172-
unsigned long __gu_val; \
172+
unsigned long __gu_val = 0; \
173173
__get_user_common(__gu_val, sizeof(*(ptr)), __gu_ptr, __gu_err);\
174174
(x) = (__force __typeof__(x))__gu_val; \
175175
__gu_err; \

0 commit comments

Comments
 (0)