]> git.hungrycats.org Git - linux/commitdiff
[PATCH] jantior: return -EFAULT on copy_user error
authorRandy Dunlap <rddunlap@osdl.org>
Fri, 1 Aug 2003 08:02:04 +0000 (01:02 -0700)
committerGreg Kroah-Hartman <greg@kroah.com>
Fri, 1 Aug 2003 08:02:04 +0000 (01:02 -0700)
From: Daniele Bellucci <bellucda@tiscali.it>

Return proper error code from copy_to_user failure in fs/sysfs/bin.c

fs/sysfs/bin.c

index 7f0d265d0bb98c001ca73a8353b7ca1f052a7595..dac4ce1aded9cbcec2fb2f61ae2435e20f13fd99 100644 (file)
@@ -47,8 +47,8 @@ read(struct file * file, char __user * userbuf, size_t count, loff_t * off)
                return ret;
        count = ret;
 
-       if (copy_to_user(userbuf, buffer + offs, count) != 0)
-               return -EINVAL;
+       if (copy_to_user(userbuf, buffer + offs, count))
+               return -EFAULT;
 
        pr_debug("offs = %lld, *off = %lld, count = %zd\n", offs, *off, count);