wifi: cfg80211: stop PMSR before P2P and NAN teardown
PATCH 1/1 wifi: cfg80211: stop PMSR before P2P and NAN teardown
PMSR request teardown must abort active measurements while the wireless_dev is still present in the driver. cfg80211_leave_locked() and cfg80211_stop_pd() already do this before invoking the driver's stop callback, but cfg80211_stop_p2p_device() and cfg80211_stop_nan() do not.
Those helpers are also called directly by nl80211, rfkill shutdown, and wireless_dev unregister paths. If one of these paths stops a P2P device or NAN interface with a pending request, it removes the mac80211 subinterface from the driver first. Subsequent request cleanup cannot reach the lower driver's abort callback, but cfg80211 frees the request regardless. Driver state can then retain a stale request and use it when it later reports a result.
Call cfg80211_pmsr_wdev_down() before stopping the P2P device or NAN interface. This keeps lower-driver request state and cfg80211 request ownership in sync for all of the helpers' callers.
--- net/wireless/core.c | 3 +++ 1 file changed, 3 insertions(+)
net/wireless/core.c +3 -0
@@ -237,6 +237,7 @@ void cfg80211_stop_p2p_device(struct cfg80211_registered_device *rdev,if (!wdev_running (wdev))return ; +cfg80211_pmsr_wdev_down (wdev);rdev_stop_p2p_device (rdev, wdev); wdev->is_running = false;
@@ -264,6 +265,8 @@ void cfg80211_stop_nan(struct cfg80211_registered_device *rdev,if (!wdev_running (wdev))return ; +cfg80211_pmsr_wdev_down (wdev); +/* * If there is a scheduled update pending, mark it as canceled, so the * empty schedule will be accepted
base-commit: 4a0bd262df757b25fc4e2a53c947317c119ced4e
Signature · 1 line
2.50.1 (Apple Git-155)