summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/lpfc/lpfc_init.c
diff options
context:
space:
mode:
authorJames Smart2012-05-10 03:16:03 +0200
committerJames Bottomley2012-05-17 11:23:38 +0200
commit587a37f6e007e97e4f88f10a51f5d0bc62eb6e0a (patch)
treefbf13c7cb9b8a5ddc05fd5b5825154dee1b07548 /drivers/scsi/lpfc/lpfc_init.c
parent[SCSI] sg: constify sg_proc_leaf_arr (diff)
downloadkernel-qcow2-linux-587a37f6e007e97e4f88f10a51f5d0bc62eb6e0a.tar.gz
kernel-qcow2-linux-587a37f6e007e97e4f88f10a51f5d0bc62eb6e0a.tar.xz
kernel-qcow2-linux-587a37f6e007e97e4f88f10a51f5d0bc62eb6e0a.zip
[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>
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_init.c')
-rw-r--r--drivers/scsi/lpfc/lpfc_init.c10
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)
/* 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 */
@@ -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 */