diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2014-10-21 20:56:42 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-11-21 09:23:01 -0800 |
commit | b77034fb4913a44b957fa3c12d49f2adf33fdc32 (patch) | |
tree | bdbd8722c35f5eb47c92d28ce734c25a820dafc3 /net | |
parent | 39630ccbb373121742c1982ee8c138314fa80b9b (diff) | |
download | kernel-common-b77034fb4913a44b957fa3c12d49f2adf33fdc32.tar.gz kernel-common-b77034fb4913a44b957fa3c12d49f2adf33fdc32.tar.bz2 kernel-common-b77034fb4913a44b957fa3c12d49f2adf33fdc32.zip |
mac80211: properly flush delayed scan work on interface removal
commit 46238845bd609a5c0fbe076e1b82b4c5b33360b2 upstream.
When an interface is deleted, an ongoing hardware scan is canceled and
the driver must abort the scan, at the very least reporting completion
while the interface is removed.
However, if it scheduled the work that might only run after everything
is said and done, which leads to cfg80211 warning that the scan isn't
reported as finished yet; this is no fault of the driver, it already
did, but mac80211 hasn't processed it.
To fix this situation, flush the delayed work when the interface being
removed is the one that was executing the scan.
Reported-by: Sujith Manoharan <sujith@msujith.org>
Tested-by: Sujith Manoharan <sujith@msujith.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net')
-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 8f7fabc46c97..06f5de4e4fbb 100644 --- a/net/mac80211/iface.c +++ b/net/mac80211/iface.c @@ -760,10 +760,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); /* @@ -973,6 +975,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); |