Skip to contentSkip to conversation

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

PATCH New Dan Carpenter 1 participant 1 message Aug 26, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/3 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")
drivers/staging/lustre/lustre/obdclass/class_obd.c +0 -1
index 57c84e8e1d8e..8ad3adb2ceb1 100644
@@ -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;
 	}