aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorJohannes Berg2013-02-22 05:55:01 -0600
committerJohannes Berg2013-02-25 17:09:19 -0600
commit1b91731d23a3dd8e8d7e3ee21b8c6d6d4cde62c1 (patch)
tree8e4e5ecaa9429f2592905f8c019082f217682560 /net
parentdc4a787c8f52f9d6e46156953f8014a3353bcbc7 (diff)
downloadam43-linux-kernel-1b91731d23a3dd8e8d7e3ee21b8c6d6d4cde62c1.tar.gz
am43-linux-kernel-1b91731d23a3dd8e8d7e3ee21b8c6d6d4cde62c1.tar.xz
am43-linux-kernel-1b91731d23a3dd8e8d7e3ee21b8c6d6d4cde62c1.zip
mac80211: fix tim_lock locking
The ieee80211_beacon_add_tim() function might be called by drivers with BHs enabled, which causes a potential deadlock if TX happens at the same time and attempts to lock the tim_lock as well. Use spin_lock_bh to fix it. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net')
-rw-r--r--net/mac80211/tx.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 5b9602b6240..5800c7a0d07 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -2360,9 +2360,9 @@ static int ieee80211_beacon_add_tim(struct ieee80211_sub_if_data *sdata,
2360 if (local->tim_in_locked_section) { 2360 if (local->tim_in_locked_section) {
2361 __ieee80211_beacon_add_tim(sdata, ps, skb); 2361 __ieee80211_beacon_add_tim(sdata, ps, skb);
2362 } else { 2362 } else {
2363 spin_lock(&local->tim_lock); 2363 spin_lock_bh(&local->tim_lock);
2364 __ieee80211_beacon_add_tim(sdata, ps, skb); 2364 __ieee80211_beacon_add_tim(sdata, ps, skb);
2365 spin_unlock(&local->tim_lock); 2365 spin_unlock_bh(&local->tim_lock);
2366 } 2366 }
2367 2367
2368 return 0; 2368 return 0;