diff options
author | Ingo Molnar <mingo@kernel.org> | 2016-09-15 02:24:53 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2016-09-15 02:24:53 -0400 |
commit | d4b80afbba49e968623330f1336da8c724da8aad (patch) | |
tree | a9478bd77d8b001a6a7119328d34e9666d7bfe93 /arch/microblaze | |
parent | fcd709ef20a9d83bdb7524d27cd6719dac8690a0 (diff) | |
parent | 4cea8776571b18db7485930cb422faa739580c8c (diff) |
Merge branch 'linus' into x86/asm, to pick up recent fixes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/microblaze')
-rw-r--r-- | arch/microblaze/include/asm/uaccess.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/arch/microblaze/include/asm/uaccess.h b/arch/microblaze/include/asm/uaccess.h index 331b0d35f89c..826676778094 100644 --- a/arch/microblaze/include/asm/uaccess.h +++ b/arch/microblaze/include/asm/uaccess.h | |||
@@ -227,7 +227,7 @@ extern long __user_bad(void); | |||
227 | 227 | ||
228 | #define __get_user(x, ptr) \ | 228 | #define __get_user(x, ptr) \ |
229 | ({ \ | 229 | ({ \ |
230 | unsigned long __gu_val; \ | 230 | unsigned long __gu_val = 0; \ |
231 | /*unsigned long __gu_ptr = (unsigned long)(ptr);*/ \ | 231 | /*unsigned long __gu_ptr = (unsigned long)(ptr);*/ \ |
232 | long __gu_err; \ | 232 | long __gu_err; \ |
233 | switch (sizeof(*(ptr))) { \ | 233 | switch (sizeof(*(ptr))) { \ |
@@ -373,10 +373,13 @@ extern long __user_bad(void); | |||
373 | static inline long copy_from_user(void *to, | 373 | static inline long copy_from_user(void *to, |
374 | const void __user *from, unsigned long n) | 374 | const void __user *from, unsigned long n) |
375 | { | 375 | { |
376 | unsigned long res = n; | ||
376 | might_fault(); | 377 | might_fault(); |
377 | if (access_ok(VERIFY_READ, from, n)) | 378 | if (likely(access_ok(VERIFY_READ, from, n))) |
378 | return __copy_from_user(to, from, n); | 379 | res = __copy_from_user(to, from, n); |
379 | return n; | 380 | if (unlikely(res)) |
381 | memset(to + (n - res), 0, res); | ||
382 | return res; | ||
380 | } | 383 | } |
381 | 384 | ||
382 | #define __copy_to_user(to, from, n) \ | 385 | #define __copy_to_user(to, from, n) \ |