diff options
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_init.c')
-rw-r--r-- | drivers/scsi/lpfc/lpfc_init.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c index b213d1d01fee..56ed5282117c 100644 --- a/drivers/scsi/lpfc/lpfc_init.c +++ b/drivers/scsi/lpfc/lpfc_init.c | |||
@@ -2041,8 +2041,6 @@ destroy_port(struct lpfc_vport *vport) | |||
2041 | struct Scsi_Host *shost = lpfc_shost_from_vport(vport); | 2041 | struct Scsi_Host *shost = lpfc_shost_from_vport(vport); |
2042 | struct lpfc_hba *phba = vport->phba; | 2042 | struct lpfc_hba *phba = vport->phba; |
2043 | 2043 | ||
2044 | kfree(vport->vname); | ||
2045 | |||
2046 | lpfc_debugfs_terminate(vport); | 2044 | lpfc_debugfs_terminate(vport); |
2047 | fc_remove_host(shost); | 2045 | fc_remove_host(shost); |
2048 | scsi_remove_host(shost); | 2046 | scsi_remove_host(shost); |
@@ -2716,18 +2714,27 @@ lpfc_pci_remove_one(struct pci_dev *pdev) | |||
2716 | { | 2714 | { |
2717 | struct Scsi_Host *shost = pci_get_drvdata(pdev); | 2715 | struct Scsi_Host *shost = pci_get_drvdata(pdev); |
2718 | struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; | 2716 | struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; |
2717 | struct lpfc_vport **vports; | ||
2719 | struct lpfc_hba *phba = vport->phba; | 2718 | struct lpfc_hba *phba = vport->phba; |
2719 | int i; | ||
2720 | int bars = pci_select_bars(pdev, IORESOURCE_MEM); | 2720 | int bars = pci_select_bars(pdev, IORESOURCE_MEM); |
2721 | 2721 | ||
2722 | spin_lock_irq(&phba->hbalock); | 2722 | spin_lock_irq(&phba->hbalock); |
2723 | vport->load_flag |= FC_UNLOADING; | 2723 | vport->load_flag |= FC_UNLOADING; |
2724 | spin_unlock_irq(&phba->hbalock); | 2724 | spin_unlock_irq(&phba->hbalock); |
2725 | 2725 | ||
2726 | kfree(vport->vname); | ||
2727 | lpfc_free_sysfs_attr(vport); | 2726 | lpfc_free_sysfs_attr(vport); |
2728 | 2727 | ||
2729 | kthread_stop(phba->worker_thread); | 2728 | kthread_stop(phba->worker_thread); |
2730 | 2729 | ||
2730 | /* Release all the vports against this physical port */ | ||
2731 | vports = lpfc_create_vport_work_array(phba); | ||
2732 | if (vports != NULL) | ||
2733 | for (i = 1; i <= phba->max_vpi && vports[i] != NULL; i++) | ||
2734 | fc_vport_terminate(vports[i]->fc_vport); | ||
2735 | lpfc_destroy_vport_work_array(phba, vports); | ||
2736 | |||
2737 | /* Remove FC host and then SCSI host with the physical port */ | ||
2731 | fc_remove_host(shost); | 2738 | fc_remove_host(shost); |
2732 | scsi_remove_host(shost); | 2739 | scsi_remove_host(shost); |
2733 | lpfc_cleanup(vport); | 2740 | lpfc_cleanup(vport); |