Skip to content

Commit

Permalink
wifi: mac80211: clear vif drv_priv after remove_interface when stopping
Browse files Browse the repository at this point in the history
Avoid reusing stale driver data when an interface is brought down and up
again. In order to avoid having to duplicate the memset in every single
driver, do it here.

Signed-off-by: Felix Fietkau <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Johannes Berg <[email protected]>
  • Loading branch information
nbd168 authored and jmberg-intel committed Jul 8, 2024
1 parent 34ce9c8 commit 574e609
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions net/mac80211/iface.c
Original file line number Diff line number Diff line change
Expand Up @@ -689,8 +689,12 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata, bool going_do

fallthrough;
default:
if (going_down)
drv_remove_interface(local, sdata);
if (!going_down)
break;
drv_remove_interface(local, sdata);

/* Clear private driver data to prevent reuse */
memset(sdata->vif.drv_priv, 0, local->hw.vif_data_size);
}

ieee80211_recalc_ps(local);
Expand Down

0 comments on commit 574e609

Please sign in to comment.