提交 6bbdce5a 编写于 作者: J John W. Linville 提交者: Jeff Garzik

[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: NJohn W. Linville <linville@tuxdriver.com>
上级 ff86a543
......@@ -265,6 +265,12 @@ ieee80211softmac_wx_get_rate(struct net_device *net_dev,
int err = -EINVAL;
spin_lock_irqsave(&mac->lock, flags);
if (unlikely(!mac->running)) {
err = -ENODEV;
goto out_unlock;
}
switch (mac->txrates.default_rate) {
case IEEE80211_CCK_RATE_1MB:
data->bitrate.value = 1000000;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册