From beb2df475b7cfcc3e107afb4dd2a031bc34fe416 Mon Sep 17 00:00:00 2001 From: Johannes Berg Date: Mon, 28 Aug 2023 13:59:54 +0200 Subject: [PATCH] wifi: cfg80211: sme: hold wiphy lock for wdev iteration Since we will want to remove the wdev lock in the future, lock the wiphy here to iterate and for checking the status of the connections. Reviewed-by: Emmanuel Grumbach Signed-off-by: Johannes Berg --- net/wireless/sme.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/wireless/sme.c b/net/wireless/sme.c index 53ba46f85cebb..c271f30b58fa6 100644 --- a/net/wireless/sme.c +++ b/net/wireless/sme.c @@ -703,6 +703,7 @@ static bool cfg80211_is_all_idle(void) * as chan dfs state, etc. */ for_each_rdev(rdev) { + wiphy_lock(&rdev->wiphy); list_for_each_entry(wdev, &rdev->wiphy.wdev_list, list) { wdev_lock(wdev); if (wdev->conn || wdev->connected || @@ -710,6 +711,7 @@ static bool cfg80211_is_all_idle(void) is_all_idle = false; wdev_unlock(wdev); } + wiphy_unlock(&rdev->wiphy); } return is_all_idle; -- 2.30.2