diff mbox series

[03/14] wifi: cfg80211: move wowlan disable under locks

Message ID 20230606144753.0278a2238807.I9453f32618ba16c0e48e0fda7fd5a7019056b01e@changeid
State New
Headers show
Series wifi: work cleanups part 1 | expand

Commit Message

Johannes Berg June 6, 2023, 12:49 p.m. UTC
From: Johannes Berg <johannes.berg@intel.com>

This is a driver callback, and the driver should be able
to assume that it's called with the wiphy lock held. Move
the call up so that's true, it has no other effect since
the device is already unregistering and we cannot reach
this function through other paths.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 net/wireless/core.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/net/wireless/core.c b/net/wireless/core.c
index 8215b2060136..0ae36653c49c 100644
--- a/net/wireless/core.c
+++ b/net/wireless/core.c
@@ -1065,6 +1065,10 @@  void wiphy_unregister(struct wiphy *wiphy)
 	cfg80211_rdev_list_generation++;
 	device_del(&rdev->wiphy.dev);
 
+#ifdef CONFIG_PM
+	if (rdev->wiphy.wowlan_config && rdev->ops->set_wakeup)
+		rdev_set_wakeup(rdev, false);
+#endif
 	wiphy_unlock(&rdev->wiphy);
 	rtnl_unlock();
 
@@ -1080,10 +1084,6 @@  void wiphy_unregister(struct wiphy *wiphy)
 	flush_work(&rdev->mgmt_registrations_update_wk);
 	flush_work(&rdev->background_cac_abort_wk);
 
-#ifdef CONFIG_PM
-	if (rdev->wiphy.wowlan_config && rdev->ops->set_wakeup)
-		rdev_set_wakeup(rdev, false);
-#endif
 	cfg80211_rdev_free_wowlan(rdev);
 	cfg80211_rdev_free_coalesce(rdev);
 }