summaryrefslogtreecommitdiff
path: root/package/mac80211
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2011-03-25 14:00:59 +0000
committerFelix Fietkau <nbd@openwrt.org>2011-03-25 14:00:59 +0000
commit1526792622314377fac401bdacc7934b7ec8fc48 (patch)
tree70ddd87d6a982ee8789dc1af23f980a3b5c4ff05 /package/mac80211
parent4b9553f20d97859fb902ef84fd12e21b8f27c746 (diff)
downloadmtk-20170518-1526792622314377fac401bdacc7934b7ec8fc48.zip
mtk-20170518-1526792622314377fac401bdacc7934b7ec8fc48.tar.gz
mtk-20170518-1526792622314377fac401bdacc7934b7ec8fc48.tar.bz2
mac80211: fix a deadlock in minstrel_ht when a HT client without valid MCS rates connects
SVN-Revision: 26287
Diffstat (limited to 'package/mac80211')
-rw-r--r--package/mac80211/patches/580-mac80211_fix_minstrel_ht_crash.patch47
1 files changed, 47 insertions, 0 deletions
diff --git a/package/mac80211/patches/580-mac80211_fix_minstrel_ht_crash.patch b/package/mac80211/patches/580-mac80211_fix_minstrel_ht_crash.patch
new file mode 100644
index 0000000..942bf92
--- /dev/null
+++ b/package/mac80211/patches/580-mac80211_fix_minstrel_ht_crash.patch
@@ -0,0 +1,47 @@
+--- a/net/mac80211/rc80211_minstrel_ht.c
++++ b/net/mac80211/rc80211_minstrel_ht.c
+@@ -659,18 +659,14 @@ minstrel_ht_update_caps(void *priv, stru
+ struct ieee80211_mcs_info *mcs = &sta->ht_cap.mcs;
+ struct ieee80211_local *local = hw_to_local(mp->hw);
+ u16 sta_cap = sta->ht_cap.cap;
++ int n_supported = 0;
+ int ack_dur;
+ int stbc;
+ int i;
+
+ /* fall back to the old minstrel for legacy stations */
+- if (!sta->ht_cap.ht_supported) {
+- msp->is_ht = false;
+- memset(&msp->legacy, 0, sizeof(msp->legacy));
+- msp->legacy.r = msp->ratelist;
+- msp->legacy.sample_table = msp->sample_table;
+- return mac80211_minstrel.rate_init(priv, sband, sta, &msp->legacy);
+- }
++ if (!sta->ht_cap.ht_supported)
++ goto use_legacy;
+
+ BUILD_BUG_ON(ARRAY_SIZE(minstrel_mcs_groups) !=
+ MINSTREL_MAX_STREAMS * MINSTREL_STREAM_GROUPS);
+@@ -725,7 +721,22 @@ minstrel_ht_update_caps(void *priv, stru
+
+ mi->groups[i].supported =
+ mcs->rx_mask[minstrel_mcs_groups[i].streams - 1];
++
++ if (mi->groups[i].supported)
++ n_supported++;
+ }
++
++ if (!n_supported)
++ goto use_legacy;
++
++ return;
++
++use_legacy:
++ msp->is_ht = false;
++ memset(&msp->legacy, 0, sizeof(msp->legacy));
++ msp->legacy.r = msp->ratelist;
++ msp->legacy.sample_table = msp->sample_table;
++ return mac80211_minstrel.rate_init(priv, sband, sta, &msp->legacy);
+ }
+
+ static void