]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - arch/x86/include/asm/uaccess_64.h
x86: copy_from_user() should not return -EFAULT
[karo-tx-linux.git] / arch / x86 / include / asm / uaccess_64.h
index 46324c6a4f6e3da0aba2f3a6576ade498c3ea57b..535e421498f6148ed36adaf698f54a13c58393de 100644 (file)
@@ -30,16 +30,15 @@ static inline unsigned long __must_check copy_from_user(void *to,
                                          unsigned long n)
 {
        int sz = __compiletime_object_size(to);
-       int ret = -EFAULT;
 
        might_fault();
        if (likely(sz == -1 || sz >= n))
-               ret = _copy_from_user(to, from, n);
+               n = _copy_from_user(to, from, n);
 #ifdef CONFIG_DEBUG_VM
        else
                WARN(1, "Buffer overflow detected!\n");
 #endif
-       return ret;
+       return n;
 }
 
 static __always_inline __must_check