Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mac80211: DFS setup chandef for radar_event correctly

Setup chandef for radar event correctly, before we
will clear this in ieee80211_dfs_cac_cancel() function.

Without this patch mac80211 will report wrong channel
width in case we will get radar event during active CAC.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
Reviewed-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>

authored by

Janusz Dziedzic and committed by
Johannes Berg
84a3d1c9 1fe4517c

+2 -4
+2 -4
net/mac80211/util.c
··· 2278 2278 { 2279 2279 struct ieee80211_local *local = 2280 2280 container_of(work, struct ieee80211_local, radar_detected_work); 2281 - struct cfg80211_chan_def chandef; 2281 + struct cfg80211_chan_def chandef = local->hw.conf.chandef; 2282 2282 2283 2283 ieee80211_dfs_cac_cancel(local); 2284 2284 2285 2285 if (local->use_chanctx) 2286 2286 /* currently not handled */ 2287 2287 WARN_ON(1); 2288 - else { 2289 - chandef = local->hw.conf.chandef; 2288 + else 2290 2289 cfg80211_radar_event(local->hw.wiphy, &chandef, GFP_KERNEL); 2291 - } 2292 2290 } 2293 2291 2294 2292 void ieee80211_radar_detected(struct ieee80211_hw *hw)