bcm43xx: Add error checking in bcm43xx_sprom_write()
Subsystems (3)
PATCH 1/1 bcm43xx: Add error checking in bcm43xx_sprom_write()
From: Adrian Bunk <[email protected]>
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 <[email protected]>
Signed-off-by Larry Finger <[email protected]>
drivers/net/wireless/bcm43xx/bcm43xx_main.c +2 -2
@@ -750,7 +750,7 @@ int bcm43xx_sprom_write(struct bcm43xx_pif (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_pmdelay (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 );
Quoted 7 lines · Larry Finger
From: Adrian Bunk <[email protected]>
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.
Quoted 2 lines
Signed-off-by Adrian Bunk <[email protected]>Signed-off-by Larry Finger <[email protected]>
Signed-off-by Michael Buesch <[email protected]>
Quoted 23 lines
Index:
wireless-2.6/drivers/net/wireless/bcm43xx/bcm43xx_main.c
===================================================================drivers/net/wireless/bcm43xx/bcm43xx_main.c +2
-2@@ -750,7 +750,7 @@ int bcm43xx_sprom_write(struct bcm43xx_pif (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_pmdelay (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 );
Signature · 1 line
Greetings Michael.