Commit 996c3117 authored by Dan Carpenter's avatar Dan Carpenter Committed by Johannes Berg

wifi: cfg80211: fix double lock bug in reg_wdev_chan_valid()

The locking was changed recently so now the caller holds the wiphy_lock()
lock.  Taking the lock inside the reg_wdev_chan_valid() function will
lead to a deadlock.

Fixes: f7e60032 ("wifi: cfg80211: fix locking in regulatory disconnect")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/40c4114a-6cb4-4abf-b013-300b598aba65@moroto.mountainSigned-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent f7e60032
......@@ -2404,11 +2404,8 @@ static bool reg_wdev_chan_valid(struct wiphy *wiphy, struct wireless_dev *wdev)
case NL80211_IFTYPE_P2P_GO:
case NL80211_IFTYPE_ADHOC:
case NL80211_IFTYPE_MESH_POINT:
wiphy_lock(wiphy);
ret = cfg80211_reg_can_beacon_relax(wiphy, &chandef,
iftype);
wiphy_unlock(wiphy);
if (!ret)
return ret;
break;
......
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