From: Dan Carpenter Date: Sat, 26 Aug 2017 06:02:55 +0000 (+0300) Subject: staging: lustre: obdclass: return -EFAULT if copy_to_user() fails X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=3ca121c2f4be85f3fbf398583bc8c42a145e3533;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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: b03679f6a41a ("staging: lustre: uapi: remove obd_ioctl_popdata() wrapper") Signed-off-by: Dan Carpenter Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/lustre/lustre/obdclass/class_obd.c b/drivers/staging/lustre/lustre/obdclass/class_obd.c index 57c84e8e1d8e..8ad3adb2ceb1 100644 --- a/drivers/staging/lustre/lustre/obdclass/class_obd.c +++ b/drivers/staging/lustre/lustre/obdclass/class_obd.c @@ -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; }