diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2016-09-09 19:16:58 -0400 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2016-11-20 01:01:40 +0000 |
commit | e61ab39499124b30960985a32d5435bba3076905 (patch) | |
tree | e3767a80f07877f30317cc15b48243d6ad2d57d9 /arch | |
parent | e258d3404fe81d8dd51a9a5e1b0312bfbb732d31 (diff) |
blackfin: fix copy_from_user()
commit 8f035983dd826d7e04f67b28acf8e2f08c347e41 upstream.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/blackfin/include/asm/uaccess.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/arch/blackfin/include/asm/uaccess.h b/arch/blackfin/include/asm/uaccess.h index 5cc111502822..8f9d497a20a3 100644 --- a/arch/blackfin/include/asm/uaccess.h +++ b/arch/blackfin/include/asm/uaccess.h @@ -194,11 +194,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 |