]> git.baikalelectronics.ru Git - kernel.git/commitdiff
um: Fix return value of strnlen_user()
authorRichard Weinberger <richard@nod.at>
Sat, 11 May 2013 13:35:32 +0000 (15:35 +0200)
committerRichard Weinberger <richard@nod.at>
Fri, 19 Jul 2013 08:45:17 +0000 (10:45 +0200)
In case of an error it must not return -EFAULT.
Return 0 like all other archs do.

Reported-by: toralf.foerster@gmx.de
Signed-off-by: Richard Weinberger <richard@nod.at>
arch/um/kernel/skas/uaccess.c

index 1d3e0c17340b1e12442e5e61a50ce05bd5a6c1b4..4ffb644d6c079a441628309b4ff0375b49e1f515 100644 (file)
@@ -254,6 +254,6 @@ int strnlen_user(const void __user *str, int len)
        n = buffer_op((unsigned long) str, len, 0, strnlen_chunk, &count);
        if (n == 0)
                return count + 1;
-       return -EFAULT;
+       return 0;
 }
 EXPORT_SYMBOL(strnlen_user);