Skip to contentSkip to conversation

cfg80211: fix unregistration

PATCH New Johannes Berg 1 participant 1 message Jul 13, 2009 802.11 (including cfg80211/NL80211)

lore
Share & tools
lore

Johannes Berg

author maintainer
#0 lore raw

PATCH 1/1 cfg80211: fix unregistration

The work that we cancel there requires the cfg80211_mutex, so we can't cancel it under the mutex, which is fine, we can just move it to after the locked section.

---
 net/wireless/core.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
net/wireless/core.c +5 -5
@@ -586,11 +586,6 @@ void wiphy_unregister(struct wiphy *wiph
 	/* unlock again before freeing */
 	mutex_unlock(&rdev->mtx);
 
-	cancel_work_sync(&rdev->conn_work);
-	cancel_work_sync(&rdev->scan_done_wk);
-	kfree(rdev->scan_req);
-	flush_work(&rdev->event_work);
-
 	cfg80211_debugfs_rdev_del(rdev);
 
 	/* If this device got a regulatory hint tell core its
@@ -602,6 +597,11 @@ void wiphy_unregister(struct wiphy *wiph
 	debugfs_remove(rdev->wiphy.debugfsdir);
 
 	mutex_unlock(&cfg80211_mutex);
+
+	cancel_work_sync(&rdev->conn_work);
+	cancel_work_sync(&rdev->scan_done_wk);
+	kfree(rdev->scan_req);
+	flush_work(&rdev->event_work);
 }
 EXPORT_SYMBOL(wiphy_unregister);