[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <200701221911.20544.mb@bu3sch.de>
Date: Mon, 22 Jan 2007 19:11:20 +0100
From: Michael Buesch <mb@...sch.de>
To: Larry Finger <Larry.Finger@...inger.net>
Cc: John Linville <linville@...driver.com>, netdev@...r.kernel.org,
Bcm43xx-dev@...ts.berlios.de
Subject: Re: [PATCH] bcm43xx: Check error returns in initialization routines
On Friday 19 January 2007 05:06, Larry Finger wrote:
> 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.
ACK
> Signed-off-by: Larry Finger <Larry.Finger@...inger.net>
> ---
>
> To be applied to wireless-2.6.
>
>
> Index: wireless-2.6/drivers/net/wireless/bcm43xx/bcm43xx_main.c
> ===================================================================
> --- wireless-2.6.orig/drivers/net/wireless/bcm43xx/bcm43xx_main.c
> +++ wireless-2.6/drivers/net/wireless/bcm43xx/bcm43xx_main.c
> @@ -2980,8 +2980,10 @@ static int bcm43xx_chipset_attach(struct
> err = bcm43xx_pctl_set_crystal(bcm, 1);
> if (err)
> goto out;
> - bcm43xx_pci_read_config16(bcm, PCI_STATUS, &pci_status);
> - bcm43xx_pci_write_config16(bcm, PCI_STATUS, pci_status & ~PCI_STATUS_SIG_TARGET_ABORT);
> + err = bcm43xx_pci_read_config16(bcm, PCI_STATUS, &pci_status);
> + if (err)
> + goto out;
> + err = bcm43xx_pci_write_config16(bcm, PCI_STATUS, pci_status & ~PCI_STATUS_SIG_TARGET_ABORT);
>
> out:
> return err;
> @@ -3793,12 +3795,18 @@ static int bcm43xx_attach_board(struct b
> }
> 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);
> - 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);
> - 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);
> + if (err)
> + goto err_iounmap;
>
> err = bcm43xx_chipset_attach(bcm);
> if (err)
> @@ -3889,6 +3897,7 @@ err_pci_release:
> pci_release_regions(pci_dev);
> err_pci_disable:
> pci_disable_device(pci_dev);
> + printk(KERN_ERR PFX "Unable to attach board\n");
> goto out;
> }
>
> ---
>
>
--
Greetings Michael.
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists