Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git] / arch / x86_64 / lib / usercopy.c
index db8abba..9bc2c29 100644 (file)
@@ -109,14 +109,11 @@ unsigned long clear_user(void __user *to, unsigned long n)
  * Return 0 on exception, a value greater than N if too long
  */
 
-long strnlen_user(const char __user *s, long n)
+long __strnlen_user(const char __user *s, long n)
 {
        long res = 0;
        char c;
 
-       if (!access_ok(VERIFY_READ, s, n))
-               return 0;
-
        while (1) {
                if (res>n)
                        return n+1;
@@ -129,6 +126,13 @@ long strnlen_user(const char __user *s, long n)
        }
 }
 
+long strnlen_user(const char __user *s, long n)
+{
+       if (!access_ok(VERIFY_READ, s, n))
+               return 0;
+       return __strnlen_user(s, n);
+}
+
 long strlen_user(const char __user *s)
 {
        long res = 0;