Skip to content

Commit

Permalink
wifi: cfg80211: move wowlan disable under locks
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Johannes Berg committed Jun 7, 2023
1 parent 0dcb84e commit a993df0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions net/wireless/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand All @@ -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);
}
Expand Down

0 comments on commit a993df0

Please sign in to comment.