diff options
Diffstat (limited to 'arch/mn10300/include/asm/uaccess.h')
| -rw-r--r-- | arch/mn10300/include/asm/uaccess.h | 10 | 
1 files changed, 6 insertions, 4 deletions
diff --git a/arch/mn10300/include/asm/uaccess.h b/arch/mn10300/include/asm/uaccess.h index 679dee0bbd0..537278746a1 100644 --- a/arch/mn10300/include/asm/uaccess.h +++ b/arch/mn10300/include/asm/uaccess.h @@ -15,6 +15,7 @@   * User space memory access functions   */  #include <linux/thread_info.h> +#include <linux/kernel.h>  #include <asm/page.h>  #include <asm/errno.h> @@ -160,9 +161,10 @@ struct __large_struct { unsigned long buf[100]; };  #define __get_user_check(x, ptr, size)					\  ({									\ +	const __typeof__(*(ptr))* __guc_ptr = (ptr);			\  	int _e;								\ -	if (likely(__access_ok((unsigned long) (ptr), (size))))		\ -		_e = __get_user_nocheck((x), (ptr), (size));		\ +	if (likely(__access_ok((unsigned long) __guc_ptr, (size))))	\ +		_e = __get_user_nocheck((x), __guc_ptr, (size));	\  	else {								\  		_e = -EFAULT;						\  		(x) = (__typeof__(x))0;					\ @@ -469,13 +471,13 @@ extern unsigned long __generic_copy_from_user(void *, const void __user *,  #define __copy_to_user(to, from, n)			\  ({							\ -	might_sleep();					\ +	might_fault();					\  	__copy_to_user_inatomic((to), (from), (n));	\  })  #define __copy_from_user(to, from, n)			\  ({							\ -	might_sleep();					\ +	might_fault();					\  	__copy_from_user_inatomic((to), (from), (n));	\  })  | 
