From: Stephen M. Cameron <scameron@xxxxxxxxxxxxxxxxxx> When copy_from_user fails, return -EFAULT, not -ENOMEM Signed-off-by: Stephen M. Cameron <scameron@xxxxxxxxxxxxxxxxxx> Reported-by: Robert Elliott <elliott@xxxxxx> Reviewed-by: Joe Handzik <joseph.t.handzik@xxxxxx> Reviewed-by: Scott Teel <scott.teel@xxxxxx> Cc: <stable@xxxxxxxxxxxxxxx> --- 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 majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html