summaryrefslogtreecommitdiffstats
path: root/arch/blackfin/include/asm
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2016-09-10 01:16:58 +0200
committerAl Viro <viro@zeniv.linux.org.uk>2016-09-13 23:50:16 +0200
commit8f035983dd826d7e04f67b28acf8e2f08c347e41 (patch)
treefc89fcbf3277304dbc7d763898879d58ea9fdb8e /arch/blackfin/include/asm
parentsparc32: fix copy_from_user() (diff)
downloadlinux-8f035983dd826d7e04f67b28acf8e2f08c347e41.tar.xz
linux-8f035983dd826d7e04f67b28acf8e2f08c347e41.zip
blackfin: fix copy_from_user()
Cc: stable@vger.kernel.org Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'arch/blackfin/include/asm')
-rw-r--r--arch/blackfin/include/asm/uaccess.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/arch/blackfin/include/asm/uaccess.h b/arch/blackfin/include/asm/uaccess.h
index 12f5d6851bbc..0a2a70096d8b 100644
--- a/arch/blackfin/include/asm/uaccess.h
+++ b/arch/blackfin/include/asm/uaccess.h
@@ -171,11 +171,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