summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2011-01-24 19:28:49 +0100
committerGreg Kroah-Hartman <gregkh@suse.de>2011-02-17 14:46:48 -0800
commit481335e5059076b32e768545d6a5d9bafa5ba84d (patch)
treeab07fe360eaf82ac1fefd8170396bec3db9ff25f /net
parent5df006f7d181e262a68030d89db5a16a30ff7840 (diff)
mac80211: fix a crash in ieee80211_beacon_get_tim on change_interface
commit eb3e554b4b3a56386ef5214dbe0e3935a350178b upstream. Some drivers (e.g. ath9k) do not always disable beacons when they're supposed to. When an interface is changed using the change_interface op, the mode specific sdata part is in an undefined state and trying to get a beacon at this point can produce weird crashes. To fix this, add a check for ieee80211_sdata_running before using anything from the sdata. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'net')
-rw-r--r--net/mac80211/tx.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index ab6355dd4ac0..fad02ea11520 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -2175,6 +2175,9 @@ struct sk_buff *ieee80211_beacon_get_tim(struct ieee80211_hw *hw,
sdata = vif_to_sdata(vif);
+ if (!ieee80211_sdata_running(sdata))
+ goto out;
+
if (tim_offset)
*tim_offset = 0;
if (tim_length)