diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c index 7ac4a62ed536..e55b1c2654ab 100644 --- a/net/mac80211/iface.c +++ b/net/mac80211/iface.c @@ -2286,6 +2286,8 @@ void ieee80211_remove_interfaces(struct ieee80211_local *local) list_splice_init(&local->interfaces, &unreg_list); mutex_unlock(&local->iflist_mtx); + wiphy_unlock(local->hw.wiphy); + list_for_each_entry_safe(sdata, tmp, &unreg_list, list) { bool netdev = sdata->dev; @@ -2307,7 +2309,6 @@ void ieee80211_remove_interfaces(struct ieee80211_local *local) if (!netdev) kfree(sdata); } - wiphy_unlock(local->hw.wiphy); } static int netdev_notify(struct notifier_block *nb,