]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blobdiff - drivers/scsi/qla2xxx/qla_bsg.c
[SCSI] qla2xxx: Fix for handling some error conditions in loopback.
[mirror_ubuntu-zesty-kernel.git] / drivers / scsi / qla2xxx / qla_bsg.c
index d25f0fa3a2e1160a59a0a984d1ea85d7a0d7003e..2f9bddd3c616d810303b39dc6f7cb5f22af14828 100644 (file)
@@ -568,9 +568,17 @@ qla81xx_set_loopback_mode(scsi_qla_host_t *vha, uint16_t *config,
        if (!wait_for_completion_timeout(&ha->dcbx_comp, (20 * HZ))) {
                ql_dbg(ql_dbg_user, vha, 0x7022,
                    "State change notification not received.\n");
-       } else
-               ql_dbg(ql_dbg_user, vha, 0x7023,
-                   "State change received.\n");
+               rval = -EINVAL;
+       } else {
+               if (ha->flags.idc_compl_status) {
+                       ql_dbg(ql_dbg_user, vha, 0x70c3,
+                           "Bad status in IDC Completion AEN\n");
+                       rval = -EINVAL;
+                       ha->flags.idc_compl_status = 0;
+               } else
+                       ql_dbg(ql_dbg_user, vha, 0x7023,
+                           "State change received.\n");
+       }
 
        ha->notify_dcbx_comp = 0;