Skip to content

Commit

Permalink
wifi: cfg80211: fix locking in regulatory disconnect
Browse files Browse the repository at this point in the history
This should use wiphy_lock() now instead of requiring the
RTNL, since __cfg80211_leave() via cfg80211_leave() is now
requiring that lock to be held.

Fixes: a05829a ("cfg80211: avoid holding the RTNL when calling the driver")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
  • Loading branch information
Johannes Berg committed Jun 6, 2023
1 parent 3e54ed8 commit f7e6003
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/wireless/reg.c
Original file line number Diff line number Diff line change
Expand Up @@ -2440,11 +2440,11 @@ static void reg_leave_invalid_chans(struct wiphy *wiphy)
struct wireless_dev *wdev;
struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);

ASSERT_RTNL();

wiphy_lock(wiphy);
list_for_each_entry(wdev, &rdev->wiphy.wdev_list, list)
if (!reg_wdev_chan_valid(wiphy, wdev))
cfg80211_leave(rdev, wdev);
wiphy_unlock(wiphy);
}

static void reg_check_chans_work(struct work_struct *work)
Expand Down

0 comments on commit f7e6003

Please sign in to comment.