summaryrefslogtreecommitdiff
path: root/net/mac80211/scan.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2022-09-02 16:12:55 +0200
committerJohannes Berg <johannes.berg@intel.com>2022-09-03 17:03:29 +0200
commita033afca2dc9d225cec1227a0554ad97ac00879d (patch)
tree75cbd08225f89f86dd308ae21f84307d20869539 /net/mac80211/scan.c
parentacdc3e47881d86dc1cb89d4603e3fed90ab150db (diff)
wifi: mac80211: fix double SW scan stop
When we stop a not-yet-started scan, we erroneously call into the driver, causing a sequence of sw_scan_start() followed by sw_scan_complete() twice. This will cause a warning in hwsim with next in line commit that validates the address passed to wmediumd/virtio. Fix this by doing the calls only if we were actually scanning. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/scan.c')
-rw-r--r--net/mac80211/scan.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c
index fa8ddf576bc1..a30964589a94 100644
--- a/net/mac80211/scan.c
+++ b/net/mac80211/scan.c
@@ -482,7 +482,7 @@ static void __ieee80211_scan_completed(struct ieee80211_hw *hw, bool aborted)
/* Set power back to normal operating levels. */
ieee80211_hw_config(local, 0);
- if (!hw_scan) {
+ if (!hw_scan && was_scanning) {
ieee80211_configure_filter(local);
drv_sw_scan_complete(local, scan_sdata);
ieee80211_offchannel_return(local);