Commit fa8809a5 authored by Johannes Berg's avatar Johannes Berg

wifi: cfg80211: hold wiphy lock in cfg80211_any_wiphy_oper_chan()

We have the RTNL here for the iteration, but we need to lock
each wiphy separately as well for using its data. Hold the
wiphy lock for all of the ones in the iteration. Note that
this implies we cannot already hold the wiphy mutex for the
wiphy passed by the argument, but that's true now.
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent beb2df47
...@@ -824,13 +824,17 @@ bool cfg80211_any_wiphy_oper_chan(struct wiphy *wiphy, ...@@ -824,13 +824,17 @@ bool cfg80211_any_wiphy_oper_chan(struct wiphy *wiphy,
return false; return false;
for_each_rdev(rdev) { for_each_rdev(rdev) {
bool found;
if (!reg_dfs_domain_same(wiphy, &rdev->wiphy)) if (!reg_dfs_domain_same(wiphy, &rdev->wiphy))
continue; continue;
if (cfg80211_is_wiphy_oper_chan(&rdev->wiphy, chan)) wiphy_lock(&rdev->wiphy);
return true; found = cfg80211_is_wiphy_oper_chan(&rdev->wiphy, chan) ||
cfg80211_offchan_chain_is_active(rdev, chan);
wiphy_unlock(&rdev->wiphy);
if (cfg80211_offchan_chain_is_active(rdev, chan)) if (found)
return true; return true;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment