netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] bcm43xx: Add error checking in bcm43xx_sprom_write()
@ 2006-11-06 15:48 Larry Finger
  2006-11-06 16:38 ` Michael Buesch
  0 siblings, 1 reply; 2+ messages in thread
From: Larry Finger @ 2006-11-06 15:48 UTC (permalink / raw)
  To: John Linville; +Cc: bunk, Michael Buesch, netdev, Bcm43xx-dev, Stefano Brivio

From: Adrian Bunk <bunk@stusta.de>

The Coverity checker noted that these "if (err)"'s couldn't ever be 
true.

It seems the intention was to check the return values of the 
bcm43xx_pci_write_config32()'s?

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
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
@@ -750,7 +750,7 @@ int bcm43xx_sprom_write(struct bcm43xx_p
 	if (err)
 		goto err_ctlreg;
 	spromctl |= 0x10; /* SPROM WRITE enable. */
-	bcm43xx_pci_write_config32(bcm, BCM43xx_PCICFG_SPROMCTL, spromctl);
+	err = bcm43xx_pci_write_config32(bcm, BCM43xx_PCICFG_SPROMCTL, spromctl);
 	if (err)
 		goto err_ctlreg;
 	/* We must burn lots of CPU cycles here, but that does not
@@ -772,7 +772,7 @@ int bcm43xx_sprom_write(struct bcm43xx_p
 		mdelay(20);
 	}
 	spromctl &= ~0x10; /* SPROM WRITE enable. */
-	bcm43xx_pci_write_config32(bcm, BCM43xx_PCICFG_SPROMCTL, spromctl);
+	err = bcm43xx_pci_write_config32(bcm, BCM43xx_PCICFG_SPROMCTL, spromctl);
 	if (err)
 		goto err_ctlreg;
 	mdelay(500);

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] bcm43xx: Add error checking in bcm43xx_sprom_write()
  2006-11-06 15:48 [PATCH] bcm43xx: Add error checking in bcm43xx_sprom_write() Larry Finger
@ 2006-11-06 16:38 ` Michael Buesch
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Buesch @ 2006-11-06 16:38 UTC (permalink / raw)
  To: Larry Finger; +Cc: John Linville, bunk, netdev, Bcm43xx-dev, Stefano Brivio

On Monday 06 November 2006 16:48, Larry Finger wrote:
> From: Adrian Bunk <bunk@stusta.de>
> 
> The Coverity checker noted that these "if (err)"'s couldn't ever be 
> true.
> 
> It seems the intention was to check the return values of the 
> bcm43xx_pci_write_config32()'s?

Whoops, I thought I had fixed this bug long time ago.
The patch is correct.

> Signed-off-by: Adrian Bunk <bunk@stusta.de>
> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>

Signed-off-by: Michael Buesch <mb@bu3sch.de>

> 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
> @@ -750,7 +750,7 @@ int bcm43xx_sprom_write(struct bcm43xx_p
>  	if (err)
>  		goto err_ctlreg;
>  	spromctl |= 0x10; /* SPROM WRITE enable. */
> -	bcm43xx_pci_write_config32(bcm, BCM43xx_PCICFG_SPROMCTL, spromctl);
> +	err = bcm43xx_pci_write_config32(bcm, BCM43xx_PCICFG_SPROMCTL, spromctl);
>  	if (err)
>  		goto err_ctlreg;
>  	/* We must burn lots of CPU cycles here, but that does not
> @@ -772,7 +772,7 @@ int bcm43xx_sprom_write(struct bcm43xx_p
>  		mdelay(20);
>  	}
>  	spromctl &= ~0x10; /* SPROM WRITE enable. */
> -	bcm43xx_pci_write_config32(bcm, BCM43xx_PCICFG_SPROMCTL, spromctl);
> +	err = bcm43xx_pci_write_config32(bcm, BCM43xx_PCICFG_SPROMCTL, spromctl);
>  	if (err)
>  		goto err_ctlreg;
>  	mdelay(500);
> 

-- 
Greetings Michael.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-11-06 16:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-06 15:48 [PATCH] bcm43xx: Add error checking in bcm43xx_sprom_write() Larry Finger
2006-11-06 16:38 ` Michael Buesch

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).