Commit 2dd02d74 authored by Robert Elliott's avatar Robert Elliott Committed by James Bottomley

hpsa: correct return values from driver functions.

correct return codes for error conditions
Reviewed-by: default avatarScott Teel <scott.teel@pmcs.com>
Reviewed-by: default avatarKevin Barnett <kevin.barnett@pmcs.com>
Reviewed-by: default avatarTomas Henzl <thenzl@redhat.com>
Reviewed-by: default avatarHannes Reinecke <hare@Suse.de>
Signed-off-by: default avatarRobert Elliott <elliott@hp.com>
Signed-off-by: default avatarDon Brace <don.brace@pmcs.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarJames Bottomley <JBottomley@Odin.com>
parent bf43caf3
...@@ -2655,9 +2655,9 @@ static int hpsa_get_raid_map(struct ctlr_info *h, ...@@ -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, if (fill_cmd(c, HPSA_GET_RAID_MAP, h, &this_device->raid_map,
sizeof(this_device->raid_map), 0, sizeof(this_device->raid_map), 0,
scsi3addr, TYPE_CMD)) { scsi3addr, TYPE_CMD)) {
dev_warn(&h->pdev->dev, "Out of memory in hpsa_get_raid_map()\n"); dev_warn(&h->pdev->dev, "hpsa_get_raid_map fill_cmd failed\n");
rc = -ENOMEM; cmd_free(h, c);
goto out; return -1;
} }
rc = hpsa_scsi_do_simple_cmd_with_retry(h, c, rc = hpsa_scsi_do_simple_cmd_with_retry(h, c,
PCI_DMA_FROMDEVICE, NO_TIMEOUT); PCI_DMA_FROMDEVICE, NO_TIMEOUT);
...@@ -5405,7 +5405,7 @@ static int hpsa_passthru_ioctl(struct ctlr_info *h, void __user *argp) ...@@ -5405,7 +5405,7 @@ static int hpsa_passthru_ioctl(struct ctlr_info *h, void __user *argp)
if (iocommand.buf_size > 0) { if (iocommand.buf_size > 0) {
buff = kmalloc(iocommand.buf_size, GFP_KERNEL); buff = kmalloc(iocommand.buf_size, GFP_KERNEL);
if (buff == NULL) if (buff == NULL)
return -EFAULT; return -ENOMEM;
if (iocommand.Request.Type.Direction & XFER_WRITE) { if (iocommand.Request.Type.Direction & XFER_WRITE) {
/* Copy the data into the buffer we created */ /* Copy the data into the buffer we created */
if (copy_from_user(buff, iocommand.buf, if (copy_from_user(buff, iocommand.buf,
...@@ -7955,7 +7955,7 @@ static int hpsa_alloc_ioaccel1_cmd_and_bft(struct ctlr_info *h) ...@@ -7955,7 +7955,7 @@ static int hpsa_alloc_ioaccel1_cmd_and_bft(struct ctlr_info *h)
clean_up: clean_up:
hpsa_free_ioaccel1_cmd_and_bft(h); hpsa_free_ioaccel1_cmd_and_bft(h);
return 1; return -ENOMEM;
} }
/* Free ioaccel2 mode command blocks and block fetch table */ /* Free ioaccel2 mode command blocks and block fetch table */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment