1 From: Felix Fietkau <nbd@nbd.name>
2 Date: Wed, 3 Jul 2024 12:10:01 +0200
3 Subject: [PATCH] wifi: mac80211: clear vif drv_priv after calling
6 Avoid reusing stale driver data when an interface is brought down and up
7 again. In order to avoid having to duplicate the memset in every single
10 Signed-off-by: Felix Fietkau <nbd@nbd.name>
13 --- a/net/mac80211/iface.c
14 +++ b/net/mac80211/iface.c
15 @@ -684,8 +684,12 @@ static void ieee80211_do_stop(struct iee
20 - drv_remove_interface(local, sdata);
23 + drv_remove_interface(local, sdata);
25 + /* Clear private driver data to prevent reuse */
26 + memset(sdata->vif.drv_priv, 0, local->hw.vif_data_size);
29 ieee80211_recalc_ps(local);