X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=net%2Fmac80211%2Fiface.c;h=653f5eb07a27f4432429a8fbbc4b32e7200cf4c3;hb=46238845bd609a5c0fbe076e1b82b4c5b33360b2;hp=3b9e2b7b3f307c5bbf5a8c95e986e04e0c94e933;hpb=ff1e417c7c239b7abfe70aa90460a77eaafc7f83;p=firefly-linux-kernel-4.4.55.git diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c index 3b9e2b7b3f30..653f5eb07a27 100644 --- a/net/mac80211/iface.c +++ b/net/mac80211/iface.c @@ -766,10 +766,12 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata, int i, flushed; struct ps_data *ps; struct cfg80211_chan_def chandef; + bool cancel_scan; clear_bit(SDATA_STATE_RUNNING, &sdata->state); - if (rcu_access_pointer(local->scan_sdata) == sdata) + cancel_scan = rcu_access_pointer(local->scan_sdata) == sdata; + if (cancel_scan) ieee80211_scan_cancel(local); /* @@ -992,6 +994,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) { ieee80211_stop_device(local);