projects
/
profile
/
common
/
platform
/
kernel
/
linux-artik7.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
012c06e
)
blackfin: fix copy_from_user()
author
Al Viro
<viro@zeniv.linux.org.uk>
Fri, 9 Sep 2016 23:16:58 +0000
(19:16 -0400)
committer
Greg Kroah-Hartman
<gregkh@linuxfoundation.org>
Sat, 24 Sep 2016 08:07:44 +0000
(10:07 +0200)
commit
8f035983dd826d7e04f67b28acf8e2f08c347e41
upstream.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/blackfin/include/asm/uaccess.h
patch
|
blob
|
history
diff --git
a/arch/blackfin/include/asm/uaccess.h
b/arch/blackfin/include/asm/uaccess.h
index
90612a7
..
8cd0184
100644
(file)
--- 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