diff options
| author | Al Viro <viro@zeniv.linux.org.uk> | 2016-09-09 19:16:58 -0400 |
|---|---|---|
| committer | Mister Oyster <oysterized@gmail.com> | 2017-04-11 10:57:57 +0200 |
| commit | 626656ea902140d4442e9af425b5fdf9d85e0e29 (patch) | |
| tree | 8d1fe2a1bfbec655a3bb5bbd3baef9321f81ca8a /arch | |
| parent | 10bbc7a09300f75232dc9c1bda212d69038cb3fe (diff) | |
blackfin: fix copy_from_user()
commit 8f035983dd826d7e04f67b28acf8e2f08c347e41 upstream.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Willy Tarreau <w@1wt.eu>
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 57701c3b8..a992a7884 100644 --- a/arch/blackfin/include/asm/uaccess.h +++ b/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 |
