]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
wifi: cfg80211: stop NAN and P2P in cfg80211_leave
authorMiri Korenblit <miriam.rachel.korenblit@intel.com>
Wed, 7 Jan 2026 12:04:51 +0000 (14:04 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 19 Jan 2026 09:18:14 +0000 (10:18 +0100)
Seems that there is an assumption that this function should be called
only for netdev interfaces, but it can also be called in suspend, or
from nl80211_netlink_notify (indirectly).
Note that the documentation of NL80211_ATTR_SOCKET_OWNER explicitly
says that NAN interfaces would be destroyed as well in the
nl80211_netlink_notify case.

Fix this by also stopping P2P and NAN.

Fixes: cb3b7d87652a ("cfg80211: add start / stop NAN commands")
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20260107140430.dab142cbef0b.I290cc47836d56dd7e35012ce06bec36c6da688cd@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/wireless/core.c

index 91f99208fb34522bc77465768c9da211533bca5a..22f29a1122dc0fae72c012a966a08447b45b895e 100644 (file)
@@ -1412,8 +1412,10 @@ void cfg80211_leave(struct cfg80211_registered_device *rdev,
                cfg80211_leave_ocb(rdev, dev);
                break;
        case NL80211_IFTYPE_P2P_DEVICE:
+               cfg80211_stop_p2p_device(rdev, wdev);
+               break;
        case NL80211_IFTYPE_NAN:
-               /* cannot happen, has no netdev */
+               cfg80211_stop_nan(rdev, wdev);
                break;
        case NL80211_IFTYPE_AP_VLAN:
        case NL80211_IFTYPE_MONITOR: