diff options
-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 */ |