diff options
author | Larry Finger <Larry.Finger@lwfinger.net> | 2007-01-18 23:06:59 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2007-02-09 14:57:16 -0500 |
commit | cad8cd9c3160e7e2e65c6999b58b3fde8de56aca (patch) | |
tree | 9b6225832276c2807e38460ee99a09463ad0ab17 /drivers/net/wireless/bcm43xx | |
parent | 9d4a6040fc6222ca57c271289a7540292640a5a4 (diff) |
[PATCH] bcm43xx: Check error returns in initialization routines
A number of the calls in the initialization routines fail to check the returned value for
errors. This patch adds the necessary checks and logs any errors found when appropriate.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/bcm43xx')
-rw-r--r-- | drivers/net/wireless/bcm43xx/bcm43xx_main.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_main.c b/drivers/net/wireless/bcm43xx/bcm43xx_main.c index 62c623572c82..63fc16f6e584 100644 --- a/drivers/net/wireless/bcm43xx/bcm43xx_main.c +++ b/drivers/net/wireless/bcm43xx/bcm43xx_main.c | |||
@@ -2976,8 +2976,10 @@ static int bcm43xx_chipset_attach(struct bcm43xx_private *bcm) | |||
2976 | err = bcm43xx_pctl_set_crystal(bcm, 1); | 2976 | err = bcm43xx_pctl_set_crystal(bcm, 1); |
2977 | if (err) | 2977 | if (err) |
2978 | goto out; | 2978 | goto out; |
2979 | bcm43xx_pci_read_config16(bcm, PCI_STATUS, &pci_status); | 2979 | err = bcm43xx_pci_read_config16(bcm, PCI_STATUS, &pci_status); |
2980 | bcm43xx_pci_write_config16(bcm, PCI_STATUS, pci_status & ~PCI_STATUS_SIG_TARGET_ABORT); | 2980 | if (err) |
2981 | goto out; | ||
2982 | err = bcm43xx_pci_write_config16(bcm, PCI_STATUS, pci_status & ~PCI_STATUS_SIG_TARGET_ABORT); | ||
2981 | 2983 | ||
2982 | out: | 2984 | out: |
2983 | return err; | 2985 | return err; |
@@ -3774,12 +3776,18 @@ static int bcm43xx_attach_board(struct bcm43xx_private *bcm) | |||
3774 | } | 3776 | } |
3775 | net_dev->base_addr = (unsigned long)bcm->mmio_addr; | 3777 | net_dev->base_addr = (unsigned long)bcm->mmio_addr; |
3776 | 3778 | ||
3777 | bcm43xx_pci_read_config16(bcm, PCI_SUBSYSTEM_VENDOR_ID, | 3779 | err = bcm43xx_pci_read_config16(bcm, PCI_SUBSYSTEM_VENDOR_ID, |
3778 | &bcm->board_vendor); | 3780 | &bcm->board_vendor); |
3779 | bcm43xx_pci_read_config16(bcm, PCI_SUBSYSTEM_ID, | 3781 | if (err) |
3782 | goto err_iounmap; | ||
3783 | err = bcm43xx_pci_read_config16(bcm, PCI_SUBSYSTEM_ID, | ||
3780 | &bcm->board_type); | 3784 | &bcm->board_type); |
3781 | bcm43xx_pci_read_config16(bcm, PCI_REVISION_ID, | 3785 | if (err) |
3786 | goto err_iounmap; | ||
3787 | err = bcm43xx_pci_read_config16(bcm, PCI_REVISION_ID, | ||
3782 | &bcm->board_revision); | 3788 | &bcm->board_revision); |
3789 | if (err) | ||
3790 | goto err_iounmap; | ||
3783 | 3791 | ||
3784 | err = bcm43xx_chipset_attach(bcm); | 3792 | err = bcm43xx_chipset_attach(bcm); |
3785 | if (err) | 3793 | if (err) |
@@ -3870,6 +3878,7 @@ err_pci_release: | |||
3870 | pci_release_regions(pci_dev); | 3878 | pci_release_regions(pci_dev); |
3871 | err_pci_disable: | 3879 | err_pci_disable: |
3872 | pci_disable_device(pci_dev); | 3880 | pci_disable_device(pci_dev); |
3881 | printk(KERN_ERR PFX "Unable to attach board\n"); | ||
3873 | goto out; | 3882 | goto out; |
3874 | } | 3883 | } |
3875 | 3884 | ||