diff options
author | Johannes Berg <johannes.berg@intel.com> | 2023-08-28 13:59:58 +0200 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2023-09-11 11:27:21 +0200 |
commit | 7a53b71d8ebc67b1a23b0cc8dd8b8024e3af9d27 (patch) | |
tree | 5de9a3633152bc81381e099c004621be93d3d89f /net/mac80211/iface.c | |
parent | 01ca280d323ef4a7e6732615b1faaa8877cc417f (diff) |
wifi: mac80211: hold wiphy_lock around concurrency checks
We want to replace the locking in mac80211 by just the wiphy
mutex, so hold the lock here around concurrency checks for
the future where the chanctx_mtx used inside goes away.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/iface.c')
-rw-r--r-- | net/mac80211/iface.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c index e09fec1507a6..c528a4bb7f4f 100644 --- a/net/mac80211/iface.c +++ b/net/mac80211/iface.c @@ -430,12 +430,13 @@ static int ieee80211_open(struct net_device *dev) if (!is_valid_ether_addr(dev->dev_addr)) return -EADDRNOTAVAIL; + wiphy_lock(sdata->local->hw.wiphy); err = ieee80211_check_concurrent_iface(sdata, sdata->vif.type); if (err) - return err; + goto out; - wiphy_lock(sdata->local->hw.wiphy); err = ieee80211_do_open(&sdata->wdev, true); +out: wiphy_unlock(sdata->local->hw.wiphy); return err; |