aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Vasquez <andrew.vasquez@qlogic.com>2009-04-07 01:33:45 -0400
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2009-05-20 18:21:09 -0400
commit7d0dba174af217c73931532adf6bffb91d16c40f (patch)
treee0c9201098f5838a74ea0fe53efe599252d11a6a
parentfc3ea9bcb86a1c5126807f747291563e08405944 (diff)
[SCSI] qla2xxx: Restrict model-name/description device-table usage.
Information present in static table is only valid for pre-ISP25xx adapters. Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
-rw-r--r--drivers/scsi/qla2xxx/qla_init.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index 4c14cde3295f..a4a6a146fccd 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -1538,6 +1538,7 @@ qla2x00_set_model_info(scsi_qla_host_t *vha, uint8_t *model, size_t len,
1538 char *st, *en; 1538 char *st, *en;
1539 uint16_t index; 1539 uint16_t index;
1540 struct qla_hw_data *ha = vha->hw; 1540 struct qla_hw_data *ha = vha->hw;
1541 int use_tbl = !IS_QLA25XX(ha) && IS_QLA81XX(ha);
1541 1542
1542 if (memcmp(model, BINZERO, len) != 0) { 1543 if (memcmp(model, BINZERO, len) != 0) {
1543 strncpy(ha->model_number, model, len); 1544 strncpy(ha->model_number, model, len);
@@ -1550,14 +1551,16 @@ qla2x00_set_model_info(scsi_qla_host_t *vha, uint8_t *model, size_t len,
1550 } 1551 }
1551 1552
1552 index = (ha->pdev->subsystem_device & 0xff); 1553 index = (ha->pdev->subsystem_device & 0xff);
1553 if (ha->pdev->subsystem_vendor == PCI_VENDOR_ID_QLOGIC && 1554 if (use_tbl &&
1555 ha->pdev->subsystem_vendor == PCI_VENDOR_ID_QLOGIC &&
1554 index < QLA_MODEL_NAMES) 1556 index < QLA_MODEL_NAMES)
1555 strncpy(ha->model_desc, 1557 strncpy(ha->model_desc,
1556 qla2x00_model_name[index * 2 + 1], 1558 qla2x00_model_name[index * 2 + 1],
1557 sizeof(ha->model_desc) - 1); 1559 sizeof(ha->model_desc) - 1);
1558 } else { 1560 } else {
1559 index = (ha->pdev->subsystem_device & 0xff); 1561 index = (ha->pdev->subsystem_device & 0xff);
1560 if (ha->pdev->subsystem_vendor == PCI_VENDOR_ID_QLOGIC && 1562 if (use_tbl &&
1563 ha->pdev->subsystem_vendor == PCI_VENDOR_ID_QLOGIC &&
1561 index < QLA_MODEL_NAMES) { 1564 index < QLA_MODEL_NAMES) {
1562 strcpy(ha->model_number, 1565 strcpy(ha->model_number,
1563 qla2x00_model_name[index * 2]); 1566 qla2x00_model_name[index * 2]);