diff options
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/qla4xxx/ql4_os.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c index a87fb9f00ac4..437d169a9814 100644 --- a/drivers/scsi/qla4xxx/ql4_os.c +++ b/drivers/scsi/qla4xxx/ql4_os.c | |||
@@ -398,9 +398,21 @@ static int qla4xxx_queuecommand(struct scsi_cmnd *cmd, | |||
398 | { | 398 | { |
399 | struct scsi_qla_host *ha = to_qla_host(cmd->device->host); | 399 | struct scsi_qla_host *ha = to_qla_host(cmd->device->host); |
400 | struct ddb_entry *ddb_entry = cmd->device->hostdata; | 400 | struct ddb_entry *ddb_entry = cmd->device->hostdata; |
401 | struct iscsi_cls_session *sess = ddb_entry->sess; | ||
401 | struct srb *srb; | 402 | struct srb *srb; |
402 | int rval; | 403 | int rval; |
403 | 404 | ||
405 | if (!sess) { | ||
406 | cmd->result = DID_IMM_RETRY << 16; | ||
407 | goto qc_fail_command; | ||
408 | } | ||
409 | |||
410 | rval = iscsi_session_chkready(sess); | ||
411 | if (rval) { | ||
412 | cmd->result = rval; | ||
413 | goto qc_fail_command; | ||
414 | } | ||
415 | |||
404 | if (atomic_read(&ddb_entry->state) != DDB_STATE_ONLINE) { | 416 | if (atomic_read(&ddb_entry->state) != DDB_STATE_ONLINE) { |
405 | if (atomic_read(&ddb_entry->state) == DDB_STATE_DEAD) { | 417 | if (atomic_read(&ddb_entry->state) == DDB_STATE_DEAD) { |
406 | cmd->result = DID_NO_CONNECT << 16; | 418 | cmd->result = DID_NO_CONNECT << 16; |