summaryrefslogtreecommitdiffstats
path: root/include/asm-generic
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-11-12 15:26:39 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2015-11-12 15:26:39 -0800
commit7dac7102afbeb99daa454f555f1ea1f42fad2f78 (patch)
tree024bf6c2ed2fa46cab610e6012bd3dd5f45da182 /include/asm-generic
parent3370b69eb0c1f6a05f9051e8fc3e8768461a80f7 (diff)
parentf639eeb4a60ce39f154753e3a745bd755e0fe084 (diff)
downloadlinux-stable-7dac7102afbeb99daa454f555f1ea1f42fad2f78.tar.gz
linux-stable-7dac7102afbeb99daa454f555f1ea1f42fad2f78.tar.bz2
linux-stable-7dac7102afbeb99daa454f555f1ea1f42fad2f78.zip
Merge tag 'for-4.4' of git://git.osdn.jp/gitroot/uclinux-h8/linux
Pull h8300 updates from Yoshinori Sato: "Some bug fixes" * tag 'for-4.4' of git://git.osdn.jp/gitroot/uclinux-h8/linux: h8300: enable CLKSRC_OF h8300: Don't set CROSS_COMPILE unconditionally asm-generic: {get,put}_user ptr argument evaluate only 1 time h8300: bit io fix h8300: zImage fix h8300: register address fix h8300: Fix alignment for .data h8300: unaligned divcr register support.
Diffstat (limited to 'include/asm-generic')
-rw-r--r--include/asm-generic/uaccess.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/include/asm-generic/uaccess.h b/include/asm-generic/uaccess.h
index 72d8803832ff..1bfa602958f2 100644
--- 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) \
({ \
+ void *__p = (ptr); \
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; \
})
@@ -225,9 +226,10 @@ extern int __put_user_bad(void) __attribute__((noreturn));
#define get_user(x, ptr) \
({ \
+ const void *__p = (ptr); \
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; \
})