mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
mac80211: properly flush delayed scan work on interface removal
commit 46238845bd
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>
[lizf: Backported to 3.4: rcu_access_pointer() isn't used]
Signed-off-by: Zefan Li <lizefan@huawei.com>
This commit is contained in:
parent
fbbe552c46
commit
0ec7236b1a
1 changed files with 6 additions and 1 deletions
|
@ -395,10 +395,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);
|
||||
|
||||
/*
|
||||
|
@ -562,6 +564,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);
|
||||
|
|
Loading…
Reference in a new issue