diff options
author | John W. Linville <linville@tuxdriver.com> | 2007-01-02 21:22:05 -0500 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-02-05 16:58:42 -0500 |
commit | 6bbdce5ac755e3b3cdcf9bb9fdbcc2af78ad34d0 (patch) | |
tree | 8547e58011042d938474332ffff5ef412602f69e /net/ieee80211/softmac | |
parent | ff86a543e9de35c5b17a289a58aed0be4e7b9d22 (diff) |
[PATCH] softmac: avoid assert in ieee80211softmac_wx_get_rate
Unconfigured bcm43xx device can hit an assert() during wx_get_rate
queries. This is because bcm43xx calls ieee80211softmac_start late
(i.e. during open instead of probe).
bcm43xx_net_open ->
bcm43xx_init_board ->
bcm43xx_select_wireless_core ->
ieee80211softmac_start
Fix is to check that device is running before completing
ieee80211softmac_wx_get_rate.
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/ieee80211/softmac')
-rw-r--r-- | net/ieee80211/softmac/ieee80211softmac_wx.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/net/ieee80211/softmac/ieee80211softmac_wx.c b/net/ieee80211/softmac/ieee80211softmac_wx.c index fa2f7da606a9..fb58e03b3fbd 100644 --- a/net/ieee80211/softmac/ieee80211softmac_wx.c +++ b/net/ieee80211/softmac/ieee80211softmac_wx.c | |||
@@ -265,6 +265,12 @@ ieee80211softmac_wx_get_rate(struct net_device *net_dev, | |||
265 | int err = -EINVAL; | 265 | int err = -EINVAL; |
266 | 266 | ||
267 | spin_lock_irqsave(&mac->lock, flags); | 267 | spin_lock_irqsave(&mac->lock, flags); |
268 | |||
269 | if (unlikely(!mac->running)) { | ||
270 | err = -ENODEV; | ||
271 | goto out_unlock; | ||
272 | } | ||
273 | |||
268 | switch (mac->txrates.default_rate) { | 274 | switch (mac->txrates.default_rate) { |
269 | case IEEE80211_CCK_RATE_1MB: | 275 | case IEEE80211_CCK_RATE_1MB: |
270 | data->bitrate.value = 1000000; | 276 | data->bitrate.value = 1000000; |