diff options
author | Johannes Berg <johannes.berg@intel.com> | 2023-06-06 14:49:20 +0200 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2023-06-07 19:53:04 +0200 |
commit | e9da6df7492a981b071bafd169fb4c35b45f5ebf (patch) | |
tree | de99210710e2525a5a9da004144a7d3fa33b4b61 /net/wireless/sme.c | |
parent | Merge wireless into wireless-next (diff) | |
download | linux-e9da6df7492a981b071bafd169fb4c35b45f5ebf.tar.xz linux-e9da6df7492a981b071bafd169fb4c35b45f5ebf.zip |
wifi: cfg80211: hold wiphy lock in auto-disconnect
Most code paths in cfg80211 already hold the wiphy lock,
mostly by virtue of being called from nl80211, so make
the auto-disconnect worker also hold it, aligning the
locking promises between different parts of cfg80211.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/wireless/sme.c')
-rw-r--r-- | net/wireless/sme.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/net/wireless/sme.c b/net/wireless/sme.c index 7bdeb8eea92d..247369004aaa 100644 --- a/net/wireless/sme.c +++ b/net/wireless/sme.c @@ -5,7 +5,7 @@ * (for nl80211's connect() and wext) * * Copyright 2009 Johannes Berg <johannes@sipsolutions.net> - * Copyright (C) 2009, 2020, 2022 Intel Corporation. All rights reserved. + * Copyright (C) 2009, 2020, 2022-2023 Intel Corporation. All rights reserved. * Copyright 2017 Intel Deutschland GmbH */ @@ -1569,6 +1569,7 @@ void cfg80211_autodisconnect_wk(struct work_struct *work) container_of(work, struct wireless_dev, disconnect_wk); struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy); + wiphy_lock(wdev->wiphy); wdev_lock(wdev); if (wdev->conn_owner_nlportid) { @@ -1607,4 +1608,5 @@ void cfg80211_autodisconnect_wk(struct work_struct *work) } wdev_unlock(wdev); + wiphy_unlock(wdev->wiphy); } |