mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-30 14:19:16 +00:00
wifi: cfg80211: check wiphy mutex is held for wdev mutex
This might seem pretty pointless rather than changing the locking immediately, but it seems safer to run for a while with checks and the old locking scheme, and then remove the wdev lock later. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
parent
fa8809a519
commit
1474bc87fe
1 changed files with 7 additions and 1 deletions
|
@ -238,6 +238,7 @@ void cfg80211_register_wdev(struct cfg80211_registered_device *rdev,
|
|||
static inline void wdev_lock(struct wireless_dev *wdev)
|
||||
__acquires(wdev)
|
||||
{
|
||||
lockdep_assert_held(&wdev->wiphy->mtx);
|
||||
mutex_lock(&wdev->mtx);
|
||||
__acquire(wdev->mtx);
|
||||
}
|
||||
|
@ -245,11 +246,16 @@ static inline void wdev_lock(struct wireless_dev *wdev)
|
|||
static inline void wdev_unlock(struct wireless_dev *wdev)
|
||||
__releases(wdev)
|
||||
{
|
||||
lockdep_assert_held(&wdev->wiphy->mtx);
|
||||
__release(wdev->mtx);
|
||||
mutex_unlock(&wdev->mtx);
|
||||
}
|
||||
|
||||
#define ASSERT_WDEV_LOCK(wdev) lockdep_assert_held(&(wdev)->mtx)
|
||||
static inline void ASSERT_WDEV_LOCK(struct wireless_dev *wdev)
|
||||
{
|
||||
lockdep_assert_held(&wdev->wiphy->mtx);
|
||||
lockdep_assert_held(&wdev->mtx);
|
||||
}
|
||||
|
||||
static inline bool cfg80211_has_monitors_only(struct cfg80211_registered_device *rdev)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue