wifi: mac80211: Free keys associated with NAN Device

A NAN Device interface can have keys associated with it, e.g.,
IGTK and BIGTK used for Tx. When a NAN Device interface is stopped,
we need to clear these keys.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Link: https://patch.msgid.link/20260603143624.c6c771885383.I929410cb8efec4fab2d42ead396bfefaf9f803f1@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
Ilan Peer 2026-06-03 14:36:24 +02:00 committed by Johannes Berg
parent 6aded6c104
commit 1f2b940056

View File

@ -648,6 +648,12 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata, bool going_do
spin_unlock_bh(&sdata->u.nan.de.func_lock);
}
/*
* Free the remaining keys that might be associated with the
* NAN interface, e.g., IGTK and BIGTK used for Tx.
*/
ieee80211_free_keys(sdata, true);
break;
case NL80211_IFTYPE_NAN_DATA:
RCU_INIT_POINTER(sdata->u.nan_data.nmi, NULL);