Commit 9027b149 authored by Johannes Berg's avatar Johannes Berg

regulatory: remove useless locking on exit

It would be a major problem if anything were to run
concurrently while the module is being unloaded so
remove the locking that doesn't help anything.
Acked-by: default avatarLuis R. Rodriguez <mcgrof@do-not-panic.com>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 1a919318
...@@ -2382,34 +2382,29 @@ void regulatory_exit(void) ...@@ -2382,34 +2382,29 @@ void regulatory_exit(void)
cancel_work_sync(&reg_work); cancel_work_sync(&reg_work);
cancel_delayed_work_sync(&reg_timeout); cancel_delayed_work_sync(&reg_timeout);
/* Lock to suppress warnings */
mutex_lock(&cfg80211_mutex); mutex_lock(&cfg80211_mutex);
mutex_lock(&reg_mutex); mutex_lock(&reg_mutex);
reset_regdomains(true); reset_regdomains(true);
mutex_unlock(&cfg80211_mutex);
mutex_unlock(&reg_mutex);
dev_set_uevent_suppress(&reg_pdev->dev, true); dev_set_uevent_suppress(&reg_pdev->dev, true);
platform_device_unregister(reg_pdev); platform_device_unregister(reg_pdev);
spin_lock_bh(&reg_pending_beacons_lock);
list_for_each_entry_safe(reg_beacon, btmp, &reg_pending_beacons, list) { list_for_each_entry_safe(reg_beacon, btmp, &reg_pending_beacons, list) {
list_del(&reg_beacon->list); list_del(&reg_beacon->list);
kfree(reg_beacon); kfree(reg_beacon);
} }
spin_unlock_bh(&reg_pending_beacons_lock);
list_for_each_entry_safe(reg_beacon, btmp, &reg_beacon_list, list) { list_for_each_entry_safe(reg_beacon, btmp, &reg_beacon_list, list) {
list_del(&reg_beacon->list); list_del(&reg_beacon->list);
kfree(reg_beacon); kfree(reg_beacon);
} }
spin_lock(&reg_requests_lock);
list_for_each_entry_safe(reg_request, tmp, &reg_requests_list, list) { list_for_each_entry_safe(reg_request, tmp, &reg_requests_list, list) {
list_del(&reg_request->list); list_del(&reg_request->list);
kfree(reg_request); kfree(reg_request);
} }
spin_unlock(&reg_requests_lock);
mutex_unlock(&reg_mutex);
mutex_unlock(&cfg80211_mutex);
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment