Skip to content

Commit

Permalink
mac80211: check sdata_running on set_bitrate_mask
Browse files Browse the repository at this point in the history
Otherwise, we will call the driver callback although
the sdata wasn't uploaded yet.

Signed-off-by: Eliad Peller <eliad@wizery.com>
  • Loading branch information
elp authored and Ido Reis committed Jun 7, 2012
1 parent c5b2161 commit ab7004d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions net/mac80211/cfg.c
Expand Up @@ -1912,6 +1912,9 @@ static int ieee80211_set_bitrate_mask(struct wiphy *wiphy,
struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
int i, ret;

if (!ieee80211_sdata_running(sdata))
return -ENETDOWN;

if (local->hw.flags & IEEE80211_HW_HAS_RATE_CONTROL) {
ret = drv_set_bitrate_mask(local, sdata, mask);
if (ret)
Expand Down

0 comments on commit ab7004d

Please sign in to comment.