Skip to content

Commit

Permalink
wifi: mac80211: fix double SW scan stop
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Johannes Berg committed Sep 3, 2022
1 parent acdc3e4 commit a033afc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/mac80211/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit a033afc

Please sign in to comment.