From: Felix Fietkau Date: Mon, 16 Apr 2012 20:10:42 +0000 (+0200) Subject: mac80211: fix logic error in ibss channel type check X-Git-Tag: v3.3.4~68 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=1384df42761379a44e3073e4d18defbf1ad7053c;p=karo-tx-linux.git mac80211: fix logic error in ibss channel type check commit 6741e7f048dacc92e37c5d724ff5c64e45f6c2c9 upstream. The broken check leads to rate control attempting to use HT40 while the driver is configured for HT20. This leads to interesting hardware issues. HT40 can only be used if the channel type is either HT40- or HT40+ and if the channel type of the cell matches the local type. Signed-off-by: Felix Fietkau Signed-off-by: John W. Linville Signed-off-by: Greg Kroah-Hartman --- diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c index a4643969a13b..664db6c21e0c 100644 --- a/net/mac80211/ibss.c +++ b/net/mac80211/ibss.c @@ -435,8 +435,8 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata, * fall back to HT20 if we don't use or use * the other extension channel */ - if ((channel_type == NL80211_CHAN_HT40MINUS || - channel_type == NL80211_CHAN_HT40PLUS) && + if (!(channel_type == NL80211_CHAN_HT40MINUS || + channel_type == NL80211_CHAN_HT40PLUS) || channel_type != sdata->u.ibss.channel_type) sta_ht_cap_new.cap &= ~IEEE80211_HT_CAP_SUP_WIDTH_20_40;