Skip to content

Commit

Permalink
[SCSI] lpfc 8.3.31: Fix bug with driver unload leaving a scsi host fo…
Browse files Browse the repository at this point in the history
…r 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>
  • Loading branch information
James Smart authored and James Bottomley committed May 17, 2012
1 parent 18b8ba6 commit 587a37f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions drivers/scsi/lpfc/lpfc_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -8694,8 +8694,11 @@ lpfc_pci_remove_one_s3(struct pci_dev *pdev)
/* Release all the vports against this physical port */
vports = lpfc_create_vport_work_array(phba);
if (vports != NULL)
for (i = 1; i <= phba->max_vports && vports[i] != NULL; i++)
for (i = 0; i <= phba->max_vports && vports[i] != NULL; i++) {
if (vports[i]->port_type == LPFC_PHYSICAL_PORT)
continue;
fc_vport_terminate(vports[i]->fc_vport);
}
lpfc_destroy_vport_work_array(phba, vports);

/* Remove FC host and then SCSI host with the physical port */
Expand Down Expand Up @@ -9455,8 +9458,11 @@ lpfc_pci_remove_one_s4(struct pci_dev *pdev)
/* Release all the vports against this physical port */
vports = lpfc_create_vport_work_array(phba);
if (vports != NULL)
for (i = 1; i <= phba->max_vports && vports[i] != NULL; i++)
for (i = 0; i <= phba->max_vports && vports[i] != NULL; i++) {
if (vports[i]->port_type == LPFC_PHYSICAL_PORT)
continue;
fc_vport_terminate(vports[i]->fc_vport);
}
lpfc_destroy_vport_work_array(phba, vports);

/* Remove FC host and then SCSI host with the physical port */
Expand Down

0 comments on commit 587a37f

Please sign in to comment.