Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

wifi: cfg80211: stop NAN and P2P in cfg80211_leave

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>

authored by

Miri Korenblit and committed by
Johannes Berg
e1696c8b e69fda4d

+3 -1
+3 -1
net/wireless/core.c
··· 1412 1412 cfg80211_leave_ocb(rdev, dev); 1413 1413 break; 1414 1414 case NL80211_IFTYPE_P2P_DEVICE: 1415 + cfg80211_stop_p2p_device(rdev, wdev); 1416 + break; 1415 1417 case NL80211_IFTYPE_NAN: 1416 - /* cannot happen, has no netdev */ 1418 + cfg80211_stop_nan(rdev, wdev); 1417 1419 break; 1418 1420 case NL80211_IFTYPE_AP_VLAN: 1419 1421 case NL80211_IFTYPE_MONITOR: