* [PATCH] bcm43xx-d80211: protect tx_stat callback from uninitialized device
@ 2006-04-10 0:25 Michael Buesch
0 siblings, 0 replies; only message in thread
From: Michael Buesch @ 2006-04-10 0:25 UTC (permalink / raw)
To: linville-2XuSBdqkA4R54TAoqtyWWQ
Cc: netdev-u79uwXL29TY76Z2rM5mHXA, bcm43xx-dev-0fE9KPoRgkgATYTw5x5z8w,
jbenc-AlSwsSmVLrQ
diff --git a/drivers/net/wireless/bcm43xx-d80211/bcm43xx_main.c b/drivers/net/wireless/bcm43xx-d80211/bcm43xx_main.c
index 043a5cf..f0f4f78 100644
--- a/drivers/net/wireless/bcm43xx-d80211/bcm43xx_main.c
+++ b/drivers/net/wireless/bcm43xx-d80211/bcm43xx_main.c
@@ -4128,15 +4128,19 @@ static int bcm43xx_net_get_tx_stats(stru
{
struct bcm43xx_private *bcm = bcm43xx_priv(net_dev);
unsigned long flags;
+ int err = -ENODEV;
bcm43xx_lock(bcm, flags);
- if (bcm43xx_using_pio(bcm))
- bcm43xx_pio_get_tx_stats(bcm, stats);
- else
- bcm43xx_dma_get_tx_stats(bcm, stats);
+ if (likely(bcm->initialized)) {
+ if (bcm43xx_using_pio(bcm))
+ bcm43xx_pio_get_tx_stats(bcm, stats);
+ else
+ bcm43xx_dma_get_tx_stats(bcm, stats);
+ err = 0;
+ }
bcm43xx_unlock(bcm, flags);
- return 0;
+ return err;
}
static int bcm43xx_net_get_stats(struct net_device *net_dev,
--
Greetings Michael.
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2006-04-10 0:25 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-10 0:25 [PATCH] bcm43xx-d80211: protect tx_stat callback from uninitialized device 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).