diff mbox

[3/3] mac80211: always recalc_radar on chanctx changes

Message ID 1420366399-31535-3-git-send-email-eliad@wizery.com (mailing list archive)
State Accepted
Delegated to: Johannes Berg
Headers show

Commit Message

Eliad Peller Jan. 4, 2015, 10:13 a.m. UTC
ieee80211_recalc_radar_chanctx() changes the global
local->radar_detect_enabled in case of a change
from the current chanctx radar_enabled state.

Thus, we need to make sure it will be called
even if the current chanctx is going to be
freed (so local->radar_detect_enabled will
be cleared if needed).

Signed-off-by: Eliad Peller <eliad@wizery.com>
---
 net/mac80211/chan.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/net/mac80211/chan.c b/net/mac80211/chan.c
index 7f83451..9261cc0 100644
--- a/net/mac80211/chan.c
+++ b/net/mac80211/chan.c
@@ -629,10 +629,12 @@  out:
 
 	sdata->vif.bss_conf.idle = !conf;
 
+	if (curr_ctx)
+		ieee80211_recalc_radar_chanctx(local, curr_ctx);
+
 	if (curr_ctx && ieee80211_chanctx_num_assigned(local, curr_ctx) > 0) {
 		ieee80211_recalc_chanctx_chantype(local, curr_ctx);
 		ieee80211_recalc_smps_chanctx(local, curr_ctx);
-		ieee80211_recalc_radar_chanctx(local, curr_ctx);
 		ieee80211_recalc_chanctx_min_def(local, curr_ctx);
 	}