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_attr.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_attr.c')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_attr.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c index 2bd017ffb084..74e69703ef98 100644 --- a/drivers/scsi/qla2xxx/qla_attr.c +++ b/drivers/scsi/qla2xxx/qla_attr.c | |||
@@ -1595,6 +1595,7 @@ qla24xx_vport_create(struct fc_vport *fc_vport, bool disable) | |||
1595 | struct qla_hw_data *ha = base_vha->hw; | 1595 | struct qla_hw_data *ha = base_vha->hw; |
1596 | uint16_t options = 0; | 1596 | uint16_t options = 0; |
1597 | int cnt; | 1597 | int cnt; |
1598 | struct req_que *req = ha->req_q_map[0]; | ||
1598 | 1599 | ||
1599 | ret = qla24xx_vport_create_req_sanity_check(fc_vport); | 1600 | ret = qla24xx_vport_create_req_sanity_check(fc_vport); |
1600 | if (ret) { | 1601 | if (ret) { |
@@ -1650,14 +1651,16 @@ qla24xx_vport_create(struct fc_vport *fc_vport, bool disable) | |||
1650 | 1651 | ||
1651 | qla24xx_vport_disable(fc_vport, disable); | 1652 | qla24xx_vport_disable(fc_vport, disable); |
1652 | 1653 | ||
1653 | ret = 0; | 1654 | if (ql2xmultique_tag) { |
1654 | if (ql2xmaxqueues == 1 || ql2xmultique_tag || !ha->npiv_info) | 1655 | req = ha->req_q_map[1]; |
1656 | goto vport_queue; | ||
1657 | } else if (ql2xmaxqueues == 1 || !ha->npiv_info) | ||
1655 | goto vport_queue; | 1658 | goto vport_queue; |
1656 | /* Create a request queue in QoS mode for the vport */ | 1659 | /* Create a request queue in QoS mode for the vport */ |
1657 | for (cnt = 0; cnt < ha->nvram_npiv_size; cnt++) { | 1660 | for (cnt = 0; cnt < ha->nvram_npiv_size; cnt++) { |
1658 | if (memcmp(ha->npiv_info[cnt].port_name, vha->port_name, 8) == 0 | 1661 | if (memcmp(ha->npiv_info[cnt].port_name, vha->port_name, 8) == 0 |
1659 | && memcmp(ha->npiv_info[cnt].node_name, vha->node_name, | 1662 | && memcmp(ha->npiv_info[cnt].node_name, vha->node_name, |
1660 | 8) == 0) { | 1663 | 8) == 0) { |
1661 | qos = ha->npiv_info[cnt].q_qos; | 1664 | qos = ha->npiv_info[cnt].q_qos; |
1662 | break; | 1665 | break; |
1663 | } | 1666 | } |
@@ -1669,14 +1672,16 @@ qla24xx_vport_create(struct fc_vport *fc_vport, bool disable) | |||
1669 | qla_printk(KERN_WARNING, ha, | 1672 | qla_printk(KERN_WARNING, ha, |
1670 | "Can't create request queue for vp_idx:%d\n", | 1673 | "Can't create request queue for vp_idx:%d\n", |
1671 | vha->vp_idx); | 1674 | vha->vp_idx); |
1672 | else | 1675 | else { |
1673 | DEBUG2(qla_printk(KERN_INFO, ha, | 1676 | DEBUG2(qla_printk(KERN_INFO, ha, |
1674 | "Request Que:%d (QoS: %d) created for vp_idx:%d\n", | 1677 | "Request Que:%d (QoS: %d) created for vp_idx:%d\n", |
1675 | ret, qos, vha->vp_idx)); | 1678 | ret, qos, vha->vp_idx)); |
1679 | req = ha->req_q_map[ret]; | ||
1680 | } | ||
1676 | } | 1681 | } |
1677 | 1682 | ||
1678 | vport_queue: | 1683 | vport_queue: |
1679 | vha->req = ha->req_q_map[ret]; | 1684 | vha->req = req; |
1680 | return 0; | 1685 | return 0; |
1681 | 1686 | ||
1682 | vport_create_failed_2: | 1687 | vport_create_failed_2: |