public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] staging: lustre: obdclass: return -EFAULT if copy_to_user() fails
@ 2017-08-26  6:02 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2017-08-26  6:02 UTC (permalink / raw)
  To: lustre-devel

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>

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

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2017-08-26  6:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-26  6:02 [PATCH 1/3] staging: lustre: obdclass: return -EFAULT if copy_to_user() fails Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox