aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorRoland Dreier <roland@purestorage.com>2012-06-11 21:23:15 -0400
committerNicholas Bellinger <nab@linux-iscsi.org>2012-06-12 23:12:26 -0400
commit092e1dc3f227ebef9ad45c26ef05c283ca4495a5 (patch)
treeed7d94d74e2eb78b5ed2bf93cdd8cdd0fd2371ef /drivers
parent3578ddba1ae93263d373e7bc85fd38d1f0368b78 (diff)
qla2xxx: Don't crash if we can't find cmd for failed CTIO
In qlt_do_ctio_completion(), there's no point in calling qlt_term_ctio_exchange() with a NULL cmd -- all that it does is crash in a NULL pointer dereference, since it does qlt_send_term_exchange(vha, cmd, &cmd->atio, 1); and dereferencing &cmd->atio is a bad idea if cmd itself is NULL. If we really need to do this, we could take the values from the failed CTIO we're processing, but it's not clear if it's worth the replumbing to do that. Signed-off-by: Roland Dreier <roland@purestorage.com> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/scsi/qla2xxx/qla_target.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c
index 04f80ebf09eb..c263f9016deb 100644
--- a/drivers/scsi/qla2xxx/qla_target.c
+++ b/drivers/scsi/qla2xxx/qla_target.c
@@ -2477,11 +2477,9 @@ static void qlt_do_ctio_completion(struct scsi_qla_host *vha, uint32_t handle,
2477 } 2477 }
2478 2478
2479 cmd = qlt_ctio_to_cmd(vha, handle, ctio); 2479 cmd = qlt_ctio_to_cmd(vha, handle, ctio);
2480 if (cmd == NULL) { 2480 if (cmd == NULL)
2481 if (status != CTIO_SUCCESS)
2482 qlt_term_ctio_exchange(vha, ctio, NULL, status);
2483 return; 2481 return;
2484 } 2482
2485 se_cmd = &cmd->se_cmd; 2483 se_cmd = &cmd->se_cmd;
2486 tfo = se_cmd->se_tfo; 2484 tfo = se_cmd->se_tfo;
2487 2485