diff options
Diffstat (limited to 'arch/tile/include/asm/uaccess.h')
-rw-r--r-- | arch/tile/include/asm/uaccess.h | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/arch/tile/include/asm/uaccess.h b/arch/tile/include/asm/uaccess.h index f3058afd5a88..ed17a80ec0ed 100644 --- a/arch/tile/include/asm/uaccess.h +++ b/arch/tile/include/asm/uaccess.h | |||
@@ -89,8 +89,10 @@ int __range_ok(unsigned long addr, unsigned long size); | |||
89 | * checks that the pointer is in the user space range - after calling | 89 | * checks that the pointer is in the user space range - after calling |
90 | * this function, memory access functions may still return -EFAULT. | 90 | * this function, memory access functions may still return -EFAULT. |
91 | */ | 91 | */ |
92 | #define access_ok(type, addr, size) \ | 92 | #define access_ok(type, addr, size) ({ \ |
93 | (likely(__range_ok((unsigned long)addr, size) == 0)) | 93 | __chk_user_ptr(addr); \ |
94 | likely(__range_ok((unsigned long)(addr), (size)) == 0); \ | ||
95 | }) | ||
94 | 96 | ||
95 | /* | 97 | /* |
96 | * The exception table consists of pairs of addresses: the first is the | 98 | * The exception table consists of pairs of addresses: the first is the |
@@ -134,14 +136,14 @@ struct __get_user { | |||
134 | * such extended assembler routines, though we will have to use a | 136 | * such extended assembler routines, though we will have to use a |
135 | * different return code in that case (1, 2, or 4, rather than -EFAULT). | 137 | * different return code in that case (1, 2, or 4, rather than -EFAULT). |
136 | */ | 138 | */ |
137 | extern struct __get_user __get_user_1(const void *); | 139 | extern struct __get_user __get_user_1(const void __user *); |
138 | extern struct __get_user __get_user_2(const void *); | 140 | extern struct __get_user __get_user_2(const void __user *); |
139 | extern struct __get_user __get_user_4(const void *); | 141 | extern struct __get_user __get_user_4(const void __user *); |
140 | extern struct __get_user __get_user_8(const void *); | 142 | extern struct __get_user __get_user_8(const void __user *); |
141 | extern int __put_user_1(long, void *); | 143 | extern int __put_user_1(long, void __user *); |
142 | extern int __put_user_2(long, void *); | 144 | extern int __put_user_2(long, void __user *); |
143 | extern int __put_user_4(long, void *); | 145 | extern int __put_user_4(long, void __user *); |
144 | extern int __put_user_8(long long, void *); | 146 | extern int __put_user_8(long long, void __user *); |
145 | 147 | ||
146 | /* Unimplemented routines to cause linker failures */ | 148 | /* Unimplemented routines to cause linker failures */ |
147 | extern struct __get_user __get_user_bad(void); | 149 | extern struct __get_user __get_user_bad(void); |