diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2015-11-13 00:26:39 +0100 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-11-13 00:26:39 +0100 |
commit | 7dac7102afbeb99daa454f555f1ea1f42fad2f78 (patch) | |
tree | 024bf6c2ed2fa46cab610e6012bd3dd5f45da182 /include/asm-generic | |
parent | Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm (diff) | |
parent | h8300: enable CLKSRC_OF (diff) | |
download | linux-7dac7102afbeb99daa454f555f1ea1f42fad2f78.tar.xz linux-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.h | 10 |
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; \ }) |