Code Review
/
kvmfornfv.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Upgrade to 4.4.50-rt62
[kvmfornfv.git]
/
kernel
/
arch
/
microblaze
/
include
/
asm
/
uaccess.h
diff --git
a/kernel/arch/microblaze/include/asm/uaccess.h
b/kernel/arch/microblaze/include/asm/uaccess.h
index
331b0d3
..
8266767
100644
(file)
--- a/
kernel/arch/microblaze/include/asm/uaccess.h
+++ b/
kernel/arch/microblaze/include/asm/uaccess.h
@@
-227,7
+227,7
@@
extern long __user_bad(void);
#define __get_user(x, ptr) \
({ \
#define __get_user(x, ptr) \
({ \
- unsigned long __gu_val
;
\
+ unsigned long __gu_val
= 0;
\
/*unsigned long __gu_ptr = (unsigned long)(ptr);*/ \
long __gu_err; \
switch (sizeof(*(ptr))) { \
/*unsigned long __gu_ptr = (unsigned long)(ptr);*/ \
long __gu_err; \
switch (sizeof(*(ptr))) { \
@@
-373,10
+373,13
@@
extern long __user_bad(void);
static inline long copy_from_user(void *to,
const void __user *from, unsigned long n)
{
static inline long copy_from_user(void *to,
const void __user *from, unsigned long n)
{
+ unsigned long res = n;
might_fault();
might_fault();
- if (access_ok(VERIFY_READ, from, n))
- return __copy_from_user(to, from, n);
- return n;
+ if (likely(access_ok(VERIFY_READ, from, n)))
+ res = __copy_from_user(to, from, n);
+ if (unlikely(res))
+ memset(to + (n - res), 0, res);
+ return res;
}
#define __copy_to_user(to, from, n) \
}
#define __copy_to_user(to, from, n) \