diff options
-rw-r--r-- | net/mac80211/iface.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c index 8260cd5b15d8..24ec86f6680a 100644 --- a/net/mac80211/iface.c +++ b/net/mac80211/iface.c @@ -382,10 +382,12 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata, u32 hw_reconf_flags = 0; int i; enum nl80211_channel_type orig_ct; + bool cancel_scan; clear_bit(SDATA_STATE_RUNNING, &sdata->state); - if (local->scan_sdata == sdata) + cancel_scan = local->scan_sdata == sdata; + if (cancel_scan) ieee80211_scan_cancel(local); /* @@ -543,6 +545,9 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata, ieee80211_recalc_ps(local, -1); + if (cancel_scan) + flush_delayed_work(&local->scan_work); + if (local->open_count == 0) { if (local->ops->napi_poll) napi_disable(&local->napi); |