diff options
author | Felix Fietkau <nbd@openwrt.org> | 2011-01-24 13:28:49 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-01-25 16:28:56 -0500 |
commit | eb3e554b4b3a56386ef5214dbe0e3935a350178b (patch) | |
tree | 7c107dadb64f044c7747c41e369f9780ab611cb1 /net | |
parent | bdc4bf652bc0271ba8f1f25bbd3dbac90bead44e (diff) |
mac80211: fix a crash in ieee80211_beacon_get_tim on change_interface
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>
Cc: stable@kernel.org
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/mac80211/tx.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index 5950e3abead9..b64b42bc774b 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c | |||
@@ -2230,6 +2230,9 @@ struct sk_buff *ieee80211_beacon_get_tim(struct ieee80211_hw *hw, | |||
2230 | 2230 | ||
2231 | sdata = vif_to_sdata(vif); | 2231 | sdata = vif_to_sdata(vif); |
2232 | 2232 | ||
2233 | if (!ieee80211_sdata_running(sdata)) | ||
2234 | goto out; | ||
2235 | |||
2233 | if (tim_offset) | 2236 | if (tim_offset) |
2234 | *tim_offset = 0; | 2237 | *tim_offset = 0; |
2235 | if (tim_length) | 2238 | if (tim_length) |