diff options
author | Anirban Chakraborty <anirban.chakraborty@qlogic.com> | 2009-06-03 12:55:19 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2009-06-08 15:46:44 -0400 |
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 b4c6010ee5fa..13396beae2ce 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 *, | |||
15 | struct rsp_que *rsp); | 15 | struct rsp_que *rsp); |
16 | static void qla2x00_isp_cmd(struct scsi_qla_host *, struct req_que *); | 16 | static void qla2x00_isp_cmd(struct scsi_qla_host *, struct req_que *); |
17 | 17 | ||
18 | static void qla25xx_set_que(srb_t *, struct req_que **, struct rsp_que **); | 18 | static void qla25xx_set_que(srb_t *, struct rsp_que **); |
19 | /** | 19 | /** |
20 | * qla2x00_get_cmd_direction() - Determine control_flag data direction. | 20 | * qla2x00_get_cmd_direction() - Determine control_flag data direction. |
21 | * @cmd: SCSI command | 21 | * @cmd: SCSI command |
@@ -722,7 +722,8 @@ qla24xx_start_scsi(srb_t *sp) | |||
722 | /* Setup device pointers. */ | 722 | /* Setup device pointers. */ |
723 | ret = 0; | 723 | ret = 0; |
724 | 724 | ||
725 | qla25xx_set_que(sp, &req, &rsp); | 725 | qla25xx_set_que(sp, &rsp); |
726 | req = vha->req; | ||
726 | 727 | ||
727 | /* So we know we haven't pci_map'ed anything yet */ | 728 | /* So we know we haven't pci_map'ed anything yet */ |
728 | tot_dsds = 0; | 729 | tot_dsds = 0; |
@@ -845,20 +846,15 @@ queuing_error: | |||
845 | return QLA_FUNCTION_FAILED; | 846 | return QLA_FUNCTION_FAILED; |
846 | } | 847 | } |
847 | 848 | ||
848 | static void qla25xx_set_que(srb_t *sp, struct req_que **req, | 849 | static void qla25xx_set_que(srb_t *sp, struct rsp_que **rsp) |
849 | struct rsp_que **rsp) | ||
850 | { | 850 | { |
851 | struct scsi_cmnd *cmd = sp->cmd; | 851 | struct scsi_cmnd *cmd = sp->cmd; |
852 | struct scsi_qla_host *vha = sp->fcport->vha; | ||
853 | struct qla_hw_data *ha = sp->fcport->vha->hw; | 852 | struct qla_hw_data *ha = sp->fcport->vha->hw; |
854 | int affinity = cmd->request->cpu; | 853 | int affinity = cmd->request->cpu; |
855 | 854 | ||
856 | if (ql2xmultique_tag && affinity >= 0 && | 855 | if (ql2xmultique_tag && affinity >= 0 && |
857 | affinity < ha->max_rsp_queues - 1) { | 856 | affinity < ha->max_rsp_queues - 1) |
858 | *rsp = ha->rsp_q_map[affinity + 1]; | 857 | *rsp = ha->rsp_q_map[affinity + 1]; |
859 | *req = ha->req_q_map[1]; | 858 | else |
860 | } else { | ||
861 | *req = vha->req; | ||
862 | *rsp = ha->rsp_q_map[0]; | 859 | *rsp = ha->rsp_q_map[0]; |
863 | } | ||
864 | } | 860 | } |