From: Arik Nemtsov Date: Wed, 2 Mar 2016 21:28:31 +0000 (+0200) Subject: mac80211: TDLS: always downgrade invalid chandefs X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=db8d99774c2682559b7648857697b9b588c6795a;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git mac80211: TDLS: always downgrade invalid chandefs Even if the current chandef width is equal to the station's max-BW, it doesn't mean it's a valid width for TDLS. Make sure to always check regulatory constraints in these cases. Fixes: 0fabfaafec3a ("mac80211: upgrade BW of TDLS peers when possible") Signed-off-by: Arik Nemtsov Signed-off-by: Emmanuel Grumbach Signed-off-by: Johannes Berg --- diff --git a/net/mac80211/tdls.c b/net/mac80211/tdls.c index c9eeb3f12808..43f13abe89c7 100644 --- a/net/mac80211/tdls.c +++ b/net/mac80211/tdls.c @@ -332,7 +332,7 @@ ieee80211_tdls_chandef_vht_upgrade(struct ieee80211_sub_if_data *sdata, return; /* proceed to downgrade the chandef until usable or the same */ - while (uc.width > max_width && + while (uc.width > max_width || !cfg80211_reg_can_beacon_relax(sdata->local->hw.wiphy, &uc, sdata->wdev.iftype)) ieee80211_chandef_downgrade(&uc);