From: Stephen M. Cameron <scame...@beardog.cce.hp.com>

When copy_from_user fails, return -EFAULT, not -ENOMEM

Signed-off-by: Stephen M. Cameron <scame...@beardog.cce.hp.com>
Reported-by: Robert Elliott <elli...@hp.com>
Reviewed-by: Joe Handzik <joseph.t.hand...@hp.com>
Reviewed-by: Scott Teel <scott.t...@hp.com>
Cc: <sta...@vger.kernel.org>
---
 drivers/scsi/hpsa.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index 8cd1a9b..08b34e9 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -5092,7 +5092,7 @@ static int hpsa_big_passthru_ioctl(struct ctlr_info *h, 
void __user *argp)
                }
                if (ioc->Request.Type.Direction & XFER_WRITE) {
                        if (copy_from_user(buff[sg_used], data_ptr, sz)) {
-                               status = -ENOMEM;
+                               status = -EFAULT;
                                goto cleanup1;
                        }
                } else

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to