Skip to content

Commit

Permalink
wifi: cfg80211: sme: hold wiphy lock for wdev iteration
Browse files Browse the repository at this point in the history
Since we will want to remove the wdev lock in the future,
lock the wiphy here to iterate and for checking the status
of the connections.

Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
  • Loading branch information
jmberg-intel committed Sep 11, 2023
1 parent 0320d68 commit beb2df4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions net/wireless/sme.c
Original file line number Diff line number Diff line change
Expand Up @@ -703,13 +703,15 @@ static bool cfg80211_is_all_idle(void)
* as chan dfs state, etc.
*/
for_each_rdev(rdev) {
wiphy_lock(&rdev->wiphy);
list_for_each_entry(wdev, &rdev->wiphy.wdev_list, list) {
wdev_lock(wdev);
if (wdev->conn || wdev->connected ||
cfg80211_beaconing_iface_active(wdev))
is_all_idle = false;
wdev_unlock(wdev);
}
wiphy_unlock(&rdev->wiphy);
}

return is_all_idle;
Expand Down

0 comments on commit beb2df4

Please sign in to comment.