Commit cad8cd9c authored by Larry Finger's avatar Larry Finger Committed by John W. Linville

[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: default avatarLarry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 9d4a6040
...@@ -2976,8 +2976,10 @@ static int bcm43xx_chipset_attach(struct bcm43xx_private *bcm) ...@@ -2976,8 +2976,10 @@ static int bcm43xx_chipset_attach(struct bcm43xx_private *bcm)
err = bcm43xx_pctl_set_crystal(bcm, 1); err = bcm43xx_pctl_set_crystal(bcm, 1);
if (err) if (err)
goto out; goto out;
bcm43xx_pci_read_config16(bcm, PCI_STATUS, &pci_status); err = bcm43xx_pci_read_config16(bcm, PCI_STATUS, &pci_status);
bcm43xx_pci_write_config16(bcm, PCI_STATUS, pci_status & ~PCI_STATUS_SIG_TARGET_ABORT); if (err)
goto out;
err = bcm43xx_pci_write_config16(bcm, PCI_STATUS, pci_status & ~PCI_STATUS_SIG_TARGET_ABORT);
out: out:
return err; return err;
...@@ -3774,12 +3776,18 @@ static int bcm43xx_attach_board(struct bcm43xx_private *bcm) ...@@ -3774,12 +3776,18 @@ static int bcm43xx_attach_board(struct bcm43xx_private *bcm)
} }
net_dev->base_addr = (unsigned long)bcm->mmio_addr; net_dev->base_addr = (unsigned long)bcm->mmio_addr;
bcm43xx_pci_read_config16(bcm, PCI_SUBSYSTEM_VENDOR_ID, err = bcm43xx_pci_read_config16(bcm, PCI_SUBSYSTEM_VENDOR_ID,
&bcm->board_vendor); &bcm->board_vendor);
bcm43xx_pci_read_config16(bcm, PCI_SUBSYSTEM_ID, if (err)
goto err_iounmap;
err = bcm43xx_pci_read_config16(bcm, PCI_SUBSYSTEM_ID,
&bcm->board_type); &bcm->board_type);
bcm43xx_pci_read_config16(bcm, PCI_REVISION_ID, if (err)
goto err_iounmap;
err = bcm43xx_pci_read_config16(bcm, PCI_REVISION_ID,
&bcm->board_revision); &bcm->board_revision);
if (err)
goto err_iounmap;
err = bcm43xx_chipset_attach(bcm); err = bcm43xx_chipset_attach(bcm);
if (err) if (err)
...@@ -3870,6 +3878,7 @@ err_pci_release: ...@@ -3870,6 +3878,7 @@ err_pci_release:
pci_release_regions(pci_dev); pci_release_regions(pci_dev);
err_pci_disable: err_pci_disable:
pci_disable_device(pci_dev); pci_disable_device(pci_dev);
printk(KERN_ERR PFX "Unable to attach board\n");
goto out; goto out;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment