git.openpandora.org
/
pandora-kernel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
blackfin: fix copy_from_user()
[pandora-kernel.git]
/
arch
/
blackfin
/
include
/
asm
/
uaccess.h
diff --git
a/arch/blackfin/include/asm/uaccess.h
b/arch/blackfin/include/asm/uaccess.h
index
5cc1115
..
8f9d497
100644
(file)
--- 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)
{
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);
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
}
static inline unsigned long __must_check