wifi: cfg80211: fix double lock bug in reg_wdev_chan_valid()
authorDan Carpenter <dan.carpenter@linaro.org>
Fri, 9 Jun 2023 10:48:44 +0000 (13:48 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 21 Jun 2023 14:00:54 +0000 (16:00 +0200)
commit6d304091e091ede9de77a141c2d04a0ff7dfb54f
treefee7e69511ee5e222f2f5832864d36bfaf078dc4
parentb11f953a61e95812af86fb24aad4ea10d309c84c
wifi: cfg80211: fix double lock bug in reg_wdev_chan_valid()

commit 996c3117dae4c02b38a3cb68e5c2aec9d907ec15 upstream.

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: f7e60032c661 ("wifi: cfg80211: fix locking in regulatory disconnect")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/40c4114a-6cb4-4abf-b013-300b598aba65@moroto.mountain
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/wireless/reg.c