diff --git a/include/asm-generic/uaccess.h b/include/asm-generic/uaccess.h
index b218b85..7b7e61e 100644
--- a/include/asm-generic/uaccess.h
+++ b/include/asm-generic/uaccess.h
@@ -162,9 +162,10 @@ static inline __must_check long __copy_to_user(void __user *to,
#define put_user(x, ptr) \
({ \
+ __typeof__(*(ptr)) __user *__pu_addr = (ptr); \
might_sleep(); \
- access_ok(VERIFY_WRITE, ptr, sizeof(*ptr)) ? \
- __put_user(x, ptr) : \
+ access_ok(VERIFY_WRITE, __pu_addr, sizeof(*ptr)) ? \
+ __put_user(x, __pu_addr) : \