cciss: return -EFAULT if copy_from_user() fails
Return -EFAULT instead of -ENOMEM if copy_from_user() fails.
Signed-off-by: Nikanth Karthikesan <knikanth@suse.de>
Acked-by: Mike Miller <mike.miller@hp.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
index 0ce0c27..aeaf465 100644
--- a/drivers/block/cciss.c
+++ b/drivers/block/cciss.c
@@ -1134,7 +1134,7 @@
if (ioc->Request.Type.Direction == XFER_WRITE) {
if (copy_from_user
(buff[sg_used], data_ptr, sz)) {
- status = -ENOMEM;
+ status = -EFAULT;
goto cleanup1;
}
} else {