diff options
author | James Smart <James.Smart@Emulex.Com> | 2006-04-16 22:26:50 -0400 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.il.steeleye.com> | 2006-04-19 20:49:34 -0400 |
commit | defbcf11ab56e09965b2135d70f44a82a5ab5fc3 (patch) | |
tree | 1d0707b38c4c74cd5d15e5b23555772b461136d9 | |
parent | 82d9a2a2900b17223117dc10b56503acc678c337 (diff) |
[SCSI] lpfc 8.1.5 : Fix cleanup code in the lpfc_pci_probe_one() error code path
Fix cleanup code in the lpfc_pci_probe_one() error code path.
This changes the original patch by:
- hardsetting the return value from lpfc_pci_probe_one() to
-ENODEV (negative value) if we fail attach
- removes the checks from lpfc_pci_remove_one() validating the
host and phba pointers as it's no longer needed.
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
-rw-r--r-- | drivers/scsi/lpfc/lpfc_init.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c index 033778ced16c..1b16ca0f5007 100644 --- a/drivers/scsi/lpfc/lpfc_init.c +++ b/drivers/scsi/lpfc/lpfc_init.c | |||
@@ -1618,7 +1618,7 @@ lpfc_pci_probe_one(struct pci_dev *pdev, const struct pci_device_id *pid) | |||
1618 | 1618 | ||
1619 | error = lpfc_alloc_sysfs_attr(phba); | 1619 | error = lpfc_alloc_sysfs_attr(phba); |
1620 | if (error) | 1620 | if (error) |
1621 | goto out_kthread_stop; | 1621 | goto out_remove_host; |
1622 | 1622 | ||
1623 | error = request_irq(phba->pcidev->irq, lpfc_intr_handler, SA_SHIRQ, | 1623 | error = request_irq(phba->pcidev->irq, lpfc_intr_handler, SA_SHIRQ, |
1624 | LPFC_DRIVER_NAME, phba); | 1624 | LPFC_DRIVER_NAME, phba); |
@@ -1635,8 +1635,10 @@ lpfc_pci_probe_one(struct pci_dev *pdev, const struct pci_device_id *pid) | |||
1635 | phba->HCregaddr = phba->ctrl_regs_memmap_p + HC_REG_OFFSET; | 1635 | phba->HCregaddr = phba->ctrl_regs_memmap_p + HC_REG_OFFSET; |
1636 | 1636 | ||
1637 | error = lpfc_sli_hba_setup(phba); | 1637 | error = lpfc_sli_hba_setup(phba); |
1638 | if (error) | 1638 | if (error) { |
1639 | error = -ENODEV; | ||
1639 | goto out_free_irq; | 1640 | goto out_free_irq; |
1641 | } | ||
1640 | 1642 | ||
1641 | if (phba->cfg_poll & DISABLE_FCP_RING_INT) { | 1643 | if (phba->cfg_poll & DISABLE_FCP_RING_INT) { |
1642 | spin_lock_irq(phba->host->host_lock); | 1644 | spin_lock_irq(phba->host->host_lock); |
@@ -1691,6 +1693,9 @@ out_free_irq: | |||
1691 | free_irq(phba->pcidev->irq, phba); | 1693 | free_irq(phba->pcidev->irq, phba); |
1692 | out_free_sysfs_attr: | 1694 | out_free_sysfs_attr: |
1693 | lpfc_free_sysfs_attr(phba); | 1695 | lpfc_free_sysfs_attr(phba); |
1696 | out_remove_host: | ||
1697 | fc_remove_host(phba->host); | ||
1698 | scsi_remove_host(phba->host); | ||
1694 | out_kthread_stop: | 1699 | out_kthread_stop: |
1695 | kthread_stop(phba->worker_thread); | 1700 | kthread_stop(phba->worker_thread); |
1696 | out_free_iocbq: | 1701 | out_free_iocbq: |
@@ -1712,12 +1717,14 @@ out_iounmap_slim: | |||
1712 | out_idr_remove: | 1717 | out_idr_remove: |
1713 | idr_remove(&lpfc_hba_index, phba->brd_no); | 1718 | idr_remove(&lpfc_hba_index, phba->brd_no); |
1714 | out_put_host: | 1719 | out_put_host: |
1720 | phba->host = NULL; | ||
1715 | scsi_host_put(host); | 1721 | scsi_host_put(host); |
1716 | out_release_regions: | 1722 | out_release_regions: |
1717 | pci_release_regions(pdev); | 1723 | pci_release_regions(pdev); |
1718 | out_disable_device: | 1724 | out_disable_device: |
1719 | pci_disable_device(pdev); | 1725 | pci_disable_device(pdev); |
1720 | out: | 1726 | out: |
1727 | pci_set_drvdata(pdev, NULL); | ||
1721 | return error; | 1728 | return error; |
1722 | } | 1729 | } |
1723 | 1730 | ||