Skip to content

Commit

Permalink
[PATCH] softmac: avoid assert in ieee80211softmac_wx_get_rate
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
John W. Linville authored and Jeff Garzik committed Feb 5, 2007
1 parent ff86a54 commit 6bbdce5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions net/ieee80211/softmac/ieee80211softmac_wx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 6bbdce5

Please sign in to comment.