aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-generic/uaccess.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-generic/uaccess.h')
-rw-r--r--include/asm-generic/uaccess.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/include/asm-generic/uaccess.h b/include/asm-generic/uaccess.h
index b218b8513d04..ac68c999b6c2 100644
--- a/include/asm-generic/uaccess.h
+++ b/include/asm-generic/uaccess.h
@@ -288,14 +288,16 @@ strncpy_from_user(char *dst, const char __user *src, long count)
288 * 288 *
289 * Return 0 on exception, a value greater than N if too long 289 * Return 0 on exception, a value greater than N if too long
290 */ 290 */
291#ifndef strnlen_user 291#ifndef __strnlen_user
292#define __strnlen_user strnlen
293#endif
294
292static inline long strnlen_user(const char __user *src, long n) 295static inline long strnlen_user(const char __user *src, long n)
293{ 296{
294 if (!access_ok(VERIFY_READ, src, 1)) 297 if (!access_ok(VERIFY_READ, src, 1))
295 return 0; 298 return 0;
296 return strlen((void * __force)src) + 1; 299 return __strnlen_user(src, n);
297} 300}
298#endif
299 301
300static inline long strlen_user(const char __user *src) 302static inline long strlen_user(const char __user *src)
301{ 303{