Skip to content

Commit

Permalink
hpsa: fix bad -ENOMEM return value in hpsa_big_passthru_ioctl
Browse files Browse the repository at this point in the history
commit 0758f4f upstream.

When copy_from_user fails, return -EFAULT, not -ENOMEM

Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Reported-by: Robert Elliott <elliott@hp.com>
Reviewed-by: Joe Handzik <joseph.t.handzik@hp.com>
Reviewed-by: Scott Teel <scott.teel@hp.com>
Reviewed by: Mike MIller <michael.miller@canonical.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
  • Loading branch information
Stephen M. Cameron authored and Jiri Slaby committed Sep 3, 2014
1 parent 82908a4 commit 085f717
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/scsi/hpsa.c
Original file line number Diff line number Diff line change
Expand Up @@ -3140,7 +3140,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
Expand Down

0 comments on commit 085f717

Please sign in to comment.