@@ -671,9 +671,11 @@ void wiphy_unregister(struct wiphy *wiphy)
rtnl_unlock();
- flush_work(&rdev->scan_done_wk);
+ cancel_work_sync(&rdev->rfkill_sync);
+ cancel_work_sync(&rdev->scan_done_wk);
+ cancel_work_sync(&rdev->sched_scan_results_wk);
cancel_work_sync(&rdev->conn_work);
- flush_work(&rdev->event_work);
+ cancel_work_sync(&rdev->event_work);
cancel_delayed_work_sync(&rdev->dfs_update_channels_wk);
#ifdef CONFIG_PM
@@ -2666,6 +2666,10 @@ void regulatory_exit(void)
cancel_work_sync(®_work);
cancel_delayed_work_sync(®_timeout);
+#ifdef CONFIG_CFG80211_INTERNAL_REGDB
+ cancel_work_sync(®_regdb_work);
+#endif
+
/* Lock to suppress warnings */
rtnl_lock();
reset_regdomains(true, NULL);
@@ -873,7 +873,7 @@ void __cfg80211_disconnected(struct net_device *dev, const u8 *ie,
wdev->wext.connect.ssid_len = 0;
#endif
- schedule_work(&cfg80211_disconnect_work);
+ queue_work(cfg80211_wq, &cfg80211_disconnect_work);
}
void cfg80211_disconnected(struct net_device *dev, u16 reason,
Rdev->rfkill_sync and rdev->sched_scan_results_wk works are canceled when unregistering wiphy. Reg_regdb_work is canceled in regulatory_exit(), if related config option is enabled. Queue cfg80211_disconnect_work to cfg80211_wq, since it's a work used by cfg80211. Change flush_work() to more robust cancel_work_sync(). Signed-off-by: Zhao, Gang <gamerh2o@gmail.com> --- net/wireless/core.c | 6 ++++-- net/wireless/reg.c | 4 ++++ net/wireless/sme.c | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-)