summaryrefslogtreecommitdiff
path: root/drivers/scsi/ips.c
diff options
context:
space:
mode:
authorHannes Reinecke <hare@suse.de>2021-01-13 10:04:56 +0100
committerMartin K. Petersen <martin.petersen@oracle.com>2021-01-22 21:14:12 -0500
commit88188179f36cade2ccb7f4734ee6430144aa060b (patch)
treebd195fa1cc972d2a019dbdcb1fb086134a971182 /drivers/scsi/ips.c
parentfc8e006c38e2d8896b53f0c1458e17a0142af392 (diff)
scsi: ips: Use correct command completion on error
A non-zero queuecommand() return code means 'busy', i.e. the command hasn't been submitted. So any command which should be failed need to be completed via the ->scsi_done() callback with the appropriate result code set. Link: https://lore.kernel.org/r/20210113090500.129644-32-hare@suse.de Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/ips.c')
-rw-r--r--drivers/scsi/ips.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/scsi/ips.c b/drivers/scsi/ips.c
index 2e6077c502fc..1a3c534826ba 100644
--- a/drivers/scsi/ips.c
+++ b/drivers/scsi/ips.c
@@ -1045,10 +1045,10 @@ static int ips_queue_lck(struct scsi_cmnd *SC, void (*done) (struct scsi_cmnd *)
ha = (ips_ha_t *) SC->device->host->hostdata;
if (!ha)
- return (1);
+ goto out_error;
if (!ha->active)
- return (DID_ERROR);
+ goto out_error;
if (ips_is_passthru(SC)) {
if (ha->copp_waitlist.count == IPS_MAX_IOCTL_QUEUE) {
@@ -1124,6 +1124,11 @@ static int ips_queue_lck(struct scsi_cmnd *SC, void (*done) (struct scsi_cmnd *)
ips_next(ha, IPS_INTR_IORL);
return (0);
+out_error:
+ SC->result = DID_ERROR << 16;
+ done(SC);
+
+ return (0);
}
static DEF_SCSI_QCMD(ips_queue)