Skip to content

Commit

Permalink
cfg80211: fix unregistration
Browse files Browse the repository at this point in the history
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.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Johannes Berg authored and John W. Linville committed Jul 24, 2009
1 parent 0e2b628 commit 6682588
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions net/wireless/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -548,11 +548,6 @@ void wiphy_unregister(struct wiphy *wiphy)
/* 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
Expand All @@ -564,6 +559,11 @@ void wiphy_unregister(struct wiphy *wiphy)
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);

Expand Down

0 comments on commit 6682588

Please sign in to comment.