netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael Buesch <mb@bu3sch.de>
To: Larry Finger <Larry.Finger@lwfinger.net>
Cc: John Linville <linville@tuxdriver.com>,
	netdev@vger.kernel.org, Bcm43xx-dev@lists.berlios.de
Subject: Re: [PATCH] bcm43xx: Check error returns in initialization routines
Date: Mon, 22 Jan 2007 19:11:20 +0100	[thread overview]
Message-ID: <200701221911.20544.mb@bu3sch.de> (raw)
In-Reply-To: <45b043e3.NGzJyc7WBaqk9U0D%Larry.Finger@lwfinger.net>

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@lwfinger.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.

      reply	other threads:[~2007-01-22 18:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-19  4:06 [PATCH] bcm43xx: Check error returns in initialization routines Larry Finger
2007-01-22 18:11 ` Michael Buesch [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200701221911.20544.mb@bu3sch.de \
    --to=mb@bu3sch.de \
    --cc=Bcm43xx-dev@lists.berlios.de \
    --cc=Larry.Finger@lwfinger.net \
    --cc=linville@tuxdriver.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).