diff options
Diffstat (limited to 'kernel/arch/blackfin/include/asm')
-rw-r--r-- | kernel/arch/blackfin/include/asm/uaccess.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/kernel/arch/blackfin/include/asm/uaccess.h b/kernel/arch/blackfin/include/asm/uaccess.h index 90612a7f2..8cd0184ea 100644 --- a/kernel/arch/blackfin/include/asm/uaccess.h +++ b/kernel/arch/blackfin/include/asm/uaccess.h @@ -177,11 +177,12 @@ static inline int bad_user_access_length(void) static inline unsigned long __must_check copy_from_user(void *to, const void __user *from, unsigned long n) { - if (access_ok(VERIFY_READ, from, n)) + if (likely(access_ok(VERIFY_READ, from, n))) { memcpy(to, (const void __force *)from, n); - else - return n; - return 0; + return 0; + } + memset(to, 0, n); + return n; } static inline unsigned long __must_check |