wifi: cfg80211: reg: hold wiphy mutex for wdev iteration
Since we will want to remove the wdev lock in the future, lock the wiphy here to iterate and check the flags. Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
parent
0e8185ce1d
commit
0320d68f56
@ -3575,14 +3575,17 @@ static bool is_wiphy_all_set_reg_flag(enum ieee80211_regulatory_flags flag)
|
|||||||
struct wireless_dev *wdev;
|
struct wireless_dev *wdev;
|
||||||
|
|
||||||
for_each_rdev(rdev) {
|
for_each_rdev(rdev) {
|
||||||
|
wiphy_lock(&rdev->wiphy);
|
||||||
list_for_each_entry(wdev, &rdev->wiphy.wdev_list, list) {
|
list_for_each_entry(wdev, &rdev->wiphy.wdev_list, list) {
|
||||||
wdev_lock(wdev);
|
wdev_lock(wdev);
|
||||||
if (!(wdev->wiphy->regulatory_flags & flag)) {
|
if (!(wdev->wiphy->regulatory_flags & flag)) {
|
||||||
wdev_unlock(wdev);
|
wdev_unlock(wdev);
|
||||||
|
wiphy_unlock(&rdev->wiphy);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
wdev_unlock(wdev);
|
wdev_unlock(wdev);
|
||||||
}
|
}
|
||||||
|
wiphy_unlock(&rdev->wiphy);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user