Skip to content

Commit

Permalink
wifi: mac80211: tighten locking check
Browse files Browse the repository at this point in the history
When we remove a link that doesn't have a channel context,
we don't really need the local->mtx locking. Tighten the
check here.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
  • Loading branch information
Johannes Berg committed Jul 15, 2022
1 parent cdf0a0a commit 939c4c7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions net/mac80211/chan.c
Original file line number Diff line number Diff line change
Expand Up @@ -1991,10 +1991,11 @@ void ieee80211_link_release_channel(struct ieee80211_link_data *link)

WARN_ON(sdata->dev && netif_carrier_ok(sdata->dev));

lockdep_assert_held(&sdata->local->mtx);

mutex_lock(&sdata->local->chanctx_mtx);
__ieee80211_link_release_channel(link);
if (rcu_access_pointer(link->conf->chanctx_conf)) {
lockdep_assert_held(&sdata->local->mtx);
__ieee80211_link_release_channel(link);
}
mutex_unlock(&sdata->local->chanctx_mtx);
}

Expand Down

0 comments on commit 939c4c7

Please sign in to comment.