summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Elliott <elliott@hp.com>2015-04-23 09:33:43 -0500
committerJames Bottomley <JBottomley@Odin.com>2015-05-31 11:34:44 -0700
commit2dd02d742535fe0114f1957afe8685856bdfebac (patch)
tree911709929fdad73da79d2d8dcdbc93f27d12066f
parentbf43caf316926fced73cfddad9f1b3f4251717e5 (diff)
hpsa: correct return values from driver functions.
correct return codes for error conditions Reviewed-by: Scott Teel <scott.teel@pmcs.com> Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com> Reviewed-by: Tomas Henzl <thenzl@redhat.com> Reviewed-by: Hannes Reinecke <hare@Suse.de> Signed-off-by: Robert Elliott <elliott@hp.com> Signed-off-by: Don Brace <don.brace@pmcs.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: James Bottomley <JBottomley@Odin.com>
-rw-r--r--drivers/scsi/hpsa.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index d91308993f14..556a94f4f991 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -2655,9 +2655,9 @@ static int hpsa_get_raid_map(struct ctlr_info *h,
if (fill_cmd(c, HPSA_GET_RAID_MAP, h, &this_device->raid_map,
sizeof(this_device->raid_map), 0,
scsi3addr, TYPE_CMD)) {
- dev_warn(&h->pdev->dev, "Out of memory in hpsa_get_raid_map()\n");
- rc = -ENOMEM;
- goto out;
+ dev_warn(&h->pdev->dev, "hpsa_get_raid_map fill_cmd failed\n");
+ cmd_free(h, c);
+ return -1;
}
rc = hpsa_scsi_do_simple_cmd_with_retry(h, c,
PCI_DMA_FROMDEVICE, NO_TIMEOUT);
@@ -5405,7 +5405,7 @@ static int hpsa_passthru_ioctl(struct ctlr_info *h, void __user *argp)
if (iocommand.buf_size > 0) {
buff = kmalloc(iocommand.buf_size, GFP_KERNEL);
if (buff == NULL)
- return -EFAULT;
+ return -ENOMEM;
if (iocommand.Request.Type.Direction & XFER_WRITE) {
/* Copy the data into the buffer we created */
if (copy_from_user(buff, iocommand.buf,
@@ -7955,7 +7955,7 @@ static int hpsa_alloc_ioaccel1_cmd_and_bft(struct ctlr_info *h)
clean_up:
hpsa_free_ioaccel1_cmd_and_bft(h);
- return 1;
+ return -ENOMEM;
}
/* Free ioaccel2 mode command blocks and block fetch table */