diff options
author | James Smart <james.smart@emulex.com> | 2012-05-09 21:16:03 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2012-05-17 05:23:38 -0400 |
commit | 587a37f6e007e97e4f88f10a51f5d0bc62eb6e0a (patch) | |
tree | fbf13c7cb9b8a5ddc05fd5b5825154dee1b07548 | |
parent | 18b8ba6cfb49b201e37489ca9761730c22be80af (diff) |
[SCSI] lpfc 8.3.31: Fix bug with driver unload leaving a scsi host for a vport around
Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
-rw-r--r-- | drivers/scsi/lpfc/lpfc_init.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c index 9598fdcb08ab..5538cd068611 100644 --- a/drivers/scsi/lpfc/lpfc_init.c +++ b/drivers/scsi/lpfc/lpfc_init.c | |||
@@ -8694,8 +8694,11 @@ lpfc_pci_remove_one_s3(struct pci_dev *pdev) | |||
8694 | /* Release all the vports against this physical port */ | 8694 | /* Release all the vports against this physical port */ |
8695 | vports = lpfc_create_vport_work_array(phba); | 8695 | vports = lpfc_create_vport_work_array(phba); |
8696 | if (vports != NULL) | 8696 | if (vports != NULL) |
8697 | for (i = 1; i <= phba->max_vports && vports[i] != NULL; i++) | 8697 | for (i = 0; i <= phba->max_vports && vports[i] != NULL; i++) { |
8698 | if (vports[i]->port_type == LPFC_PHYSICAL_PORT) | ||
8699 | continue; | ||
8698 | fc_vport_terminate(vports[i]->fc_vport); | 8700 | fc_vport_terminate(vports[i]->fc_vport); |
8701 | } | ||
8699 | lpfc_destroy_vport_work_array(phba, vports); | 8702 | lpfc_destroy_vport_work_array(phba, vports); |
8700 | 8703 | ||
8701 | /* Remove FC host and then SCSI host with the physical port */ | 8704 | /* Remove FC host and then SCSI host with the physical port */ |
@@ -9455,8 +9458,11 @@ lpfc_pci_remove_one_s4(struct pci_dev *pdev) | |||
9455 | /* Release all the vports against this physical port */ | 9458 | /* Release all the vports against this physical port */ |
9456 | vports = lpfc_create_vport_work_array(phba); | 9459 | vports = lpfc_create_vport_work_array(phba); |
9457 | if (vports != NULL) | 9460 | if (vports != NULL) |
9458 | for (i = 1; i <= phba->max_vports && vports[i] != NULL; i++) | 9461 | for (i = 0; i <= phba->max_vports && vports[i] != NULL; i++) { |
9462 | if (vports[i]->port_type == LPFC_PHYSICAL_PORT) | ||
9463 | continue; | ||
9459 | fc_vport_terminate(vports[i]->fc_vport); | 9464 | fc_vport_terminate(vports[i]->fc_vport); |
9465 | } | ||
9460 | lpfc_destroy_vport_work_array(phba, vports); | 9466 | lpfc_destroy_vport_work_array(phba, vports); |
9461 | 9467 | ||
9462 | /* Remove FC host and then SCSI host with the physical port */ | 9468 | /* Remove FC host and then SCSI host with the physical port */ |