staging: lustre: obdclass: return -EFAULT if copy_to_user() fails

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: b03679f6a4 ("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>
This commit is contained in:
Dan Carpenter
2017-08-26 09:02:55 +03:00
committed by Greg Kroah-Hartman
parent 9c8e28df44
commit 3ca121c2f4

View 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;
}