diff options
author | Anirban Chakraborty <anirban.chakraborty@qlogic.com> | 2009-06-03 09:55:19 -0700 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2009-06-08 14:46:44 -0500 |
commit | 59e0b8b088031b3b751f0608f797f2581f49a827 (patch) | |
tree | 8c1c5c84c3e86abfe9ea1bda8516988b2a8a02e2 /drivers/scsi/qla2xxx/qla_iocb.c | |
parent | 94b3aa47ac1ea0aa31b3f59ad121cdf55e038594 (diff) |
[SCSI] qla2xxx: Correct NULL pointer bug in cpu affinity mode.
This patch fixes a NULL pointer bug that occurs when IO is being
carried out on a vport for which the cpu affinity mode is turned on.
Signed-off-by: Anirban Chakraborty <anirban.chakraborty@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_iocb.c')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_iocb.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/drivers/scsi/qla2xxx/qla_iocb.c b/drivers/scsi/qla2xxx/qla_iocb.c index b4c6010ee5f..13396beae2c 100644 --- a/drivers/scsi/qla2xxx/qla_iocb.c +++ b/drivers/scsi/qla2xxx/qla_iocb.c @@ -15,7 +15,7 @@ static request_t *qla2x00_req_pkt(struct scsi_qla_host *, struct req_que *, struct rsp_que *rsp); static void qla2x00_isp_cmd(struct scsi_qla_host *, struct req_que *); -static void qla25xx_set_que(srb_t *, struct req_que **, struct rsp_que **); +static void qla25xx_set_que(srb_t *, struct rsp_que **); /** * qla2x00_get_cmd_direction() - Determine control_flag data direction. * @cmd: SCSI command @@ -722,7 +722,8 @@ qla24xx_start_scsi(srb_t *sp) /* Setup device pointers. */ ret = 0; - qla25xx_set_que(sp, &req, &rsp); + qla25xx_set_que(sp, &rsp); + req = vha->req; /* So we know we haven't pci_map'ed anything yet */ tot_dsds = 0; @@ -845,20 +846,15 @@ queuing_error: return QLA_FUNCTION_FAILED; } -static void qla25xx_set_que(srb_t *sp, struct req_que **req, - struct rsp_que **rsp) +static void qla25xx_set_que(srb_t *sp, struct rsp_que **rsp) { struct scsi_cmnd *cmd = sp->cmd; - struct scsi_qla_host *vha = sp->fcport->vha; struct qla_hw_data *ha = sp->fcport->vha->hw; int affinity = cmd->request->cpu; if (ql2xmultique_tag && affinity >= 0 && - affinity < ha->max_rsp_queues - 1) { + affinity < ha->max_rsp_queues - 1) *rsp = ha->rsp_q_map[affinity + 1]; - *req = ha->req_q_map[1]; - } else { - *req = vha->req; + else *rsp = ha->rsp_q_map[0]; - } } |