cfg80211: fix deadlock during reg chan check
cfg80211: fix deadlock during reg chan check

If a P2P GO is active, the cfg80211_reg_can_beacon function will take
the wdev lock, in its call to cfg80211_go_permissive_chan. But the wdev lock
is already taken by the parent channel-checking function, causing a
deadlock.
Split the checking code into two parts. The first part will check if the
wdev is active and saves the channel under the wdev lock. The second part
will check actual channel validity according to type.

Signed-off-by: Arik Nemtsov <d516732a7a4842c7f24dfc10745969fd6353a957@intel.com>
Reviewed-by: Ilan Peer <61a30686a541b51b1d2da34e3c8fefce57fb45f2@intel.com>
Reviewed-by: Emmanuel Grumbach <643a80aaf16a8332d6a70921c14d4bb265446494@intel.com>
Signed-off-by: Johannes Berg <bff32994ff0f8d048f262a8388145a71b6071bfe@intel.com>

KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs