projects
/
firefly-linux-kernel-4.4.55.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge remote-tracking branches 'asoc/fix/davinci', 'asoc/fix/es8328', 'asoc/fix/fsl...
[firefly-linux-kernel-4.4.55.git]
/
include
/
asm-generic
/
uaccess.h
diff --git
a/include/asm-generic/uaccess.h
b/include/asm-generic/uaccess.h
index 72d8803832ff64ef5e53b666abdcb7ea21d44a61..1bfa602958f2a2f7beb16fab8f98263d198c652b 100644
(file)
--- a/
include/asm-generic/uaccess.h
+++ b/
include/asm-generic/uaccess.h
@@
-163,9
+163,10
@@
static inline __must_check long __copy_to_user(void __user *to,
#define put_user(x, ptr) \
({ \
#define put_user(x, ptr) \
({ \
+ void *__p = (ptr); \
might_fault(); \
might_fault(); \
- access_ok(VERIFY_WRITE,
ptr
, sizeof(*ptr)) ? \
- __put_user(
x, ptr) :
\
+ access_ok(VERIFY_WRITE,
__p
, sizeof(*ptr)) ? \
+ __put_user(
(x), ((__typeof__(*(ptr)) *)__p)) :
\
-EFAULT; \
})
-EFAULT; \
})
@@
-225,9
+226,10
@@
extern int __put_user_bad(void) __attribute__((noreturn));
#define get_user(x, ptr) \
({ \
#define get_user(x, ptr) \
({ \
+ const void *__p = (ptr); \
might_fault(); \
might_fault(); \
- access_ok(VERIFY_READ,
ptr
, sizeof(*ptr)) ? \
- __get_user(
x, ptr) :
\
+ access_ok(VERIFY_READ,
__p
, sizeof(*ptr)) ? \
+ __get_user(
(x), (__typeof__(*(ptr)) *)__p) :
\
-EFAULT; \
})
-EFAULT; \
})