scsi: ips: Use correct command completion on error
[sfrench/cifs-2.6.git] / drivers / scsi / ips.c
index 2e6077c502fc71316bbd75b1e8e927fc33f4a59c..1a3c534826ba1e3e0a6f5d13b1bbf5c182ffb0b7 100644 (file)
@@ -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) {
@@ -1123,6 +1123,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);
 }