]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
staging: lustre: obdclass: return -EFAULT if copy_to_user() fails
authorDan Carpenter <dan.carpenter@oracle.com>
Sat, 26 Aug 2017 06:02:55 +0000 (09:02 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 28 Aug 2017 08:24:06 +0000 (10:24 +0200)
We recently changed from using obd_ioctl_popdata() to calling
copy_to_user() directly.  This if statement was supposed to be deleted
but it was over looked.  "err" is zero at this point so it means we
return success.

Fixes: b03679f6a41a ("staging: lustre: uapi: remove obd_ioctl_popdata() wrapper")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/obdclass/class_obd.c

index 57c84e8e1d8e68999a2438c2ea3b77e2153ad984..8ad3adb2ceb10866cccca239c39433ac1bf290ff 100644 (file)
@@ -262,7 +262,6 @@ int class_handle_ioctl(unsigned int cmd, unsigned long arg)
                       dev);
 
                if (copy_to_user((void __user *)arg, data, sizeof(*data)))
-               if (err)
                        err = -EFAULT;
                goto out;
        }