aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla4xxx/ql4_os.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/qla4xxx/ql4_os.c')
-rw-r--r--drivers/scsi/qla4xxx/ql4_os.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c
index f1c58eb26ba2..f4cd846abf6d 100644
--- a/drivers/scsi/qla4xxx/ql4_os.c
+++ b/drivers/scsi/qla4xxx/ql4_os.c
@@ -881,7 +881,13 @@ static int qla4xxx_cmd_wait(struct scsi_qla_host *ha)
881 /* Find a command that hasn't completed. */ 881 /* Find a command that hasn't completed. */
882 for (index = 0; index < ha->host->can_queue; index++) { 882 for (index = 0; index < ha->host->can_queue; index++) {
883 cmd = scsi_host_find_tag(ha->host, index); 883 cmd = scsi_host_find_tag(ha->host, index);
884 if (cmd != NULL) 884 /*
885 * We cannot just check if the index is valid,
886 * becase if we are run from the scsi eh, then
887 * the scsi/block layer is going to prevent
888 * the tag from being released.
889 */
890 if (cmd != NULL && CMD_SP(cmd))
885 break; 891 break;
886 } 892 }
887 spin_unlock_irqrestore(&ha->hardware_lock, flags); 893 spin_unlock_irqrestore(&ha->hardware_lock, flags);