cciss: return -EFAULT if copy_from_user() fails
authorNikanth Karthikesan <knikanth@suse.de>
Mon, 4 Aug 2008 08:56:07 +0000 (10:56 +0200)
committerJens Axboe <jens.axboe@oracle.com>
Wed, 6 Aug 2008 10:30:03 +0000 (12:30 +0200)
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>
drivers/block/cciss.c

index 0ce0c279aabf4bce78463537be4fe37325b91810..aeaf465922e51889a168d14035c02cf4075a753e 100644 (file)
@@ -1134,7 +1134,7 @@ static int cciss_ioctl(struct inode *inode, struct file *filep,
                                if (ioc->Request.Type.Direction == XFER_WRITE) {
                                        if (copy_from_user
                                            (buff[sg_used], data_ptr, sz)) {
-                                               status = -ENOMEM;
+                                               status = -EFAULT;
                                                goto cleanup1;
                                        }
                                } else {