aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjoern A. Zeeb <bz@FreeBSD.org>2026-05-23 21:06:32 +0000
committerBjoern A. Zeeb <bz@FreeBSD.org>2026-05-23 23:54:30 +0000
commit8ead19207e56790bd4c64dba4ddbf2e0eb6922f7 (patch)
treebba1ed54be02944fe86b6371fca18d0316eb1f96
parent4d125ed6e7d445d574c11dc35c40ec3013559806 (diff)
LinuxKPI: 802.11: reset chanctx when recycling
When we no longer need a channel context and put it back on the reserved list, zero it for all but the vif so that we get the same state as if it was freshly allocated. Sponsored by: The FreeBSD Foundation Fixes: e62c92c0a5cf, 88cb1e17f471 MFC after: 3 days
-rw-r--r--sys/compat/linuxkpi/common/src/linux_80211.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c
index b9528295ad8e..efd1d9bae3cc 100644
--- a/sys/compat/linuxkpi/common/src/linux_80211.c
+++ b/sys/compat/linuxkpi/common/src/linux_80211.c
@@ -2426,6 +2426,8 @@ lkpi_set_chanctx_conf(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
rcu_assign_pointer(vif->bss_conf.chanctx_conf, NULL);
lchanctx = CHANCTX_CONF_TO_LCHANCTX(chanctx_conf);
list_del(&lchanctx->entry);
+ memset(lchanctx, 0, sizeof(*lchanctx));
+ lchanctx->lvif = VIF_TO_LVIF(vif);
list_add_rcu(&lchanctx->entry, &lhw->lchanctx_list_reserved);
}
@@ -2460,6 +2462,8 @@ lkpi_remove_chanctx(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
lchanctx = CHANCTX_CONF_TO_LCHANCTX(chanctx_conf);
list_del(&lchanctx->entry);
lhw = HW_TO_LHW(hw);
+ memset(lchanctx, 0, sizeof(*lchanctx));
+ lchanctx->lvif = VIF_TO_LVIF(vif);
list_add_rcu(&lchanctx->entry, &lhw->lchanctx_list_reserved);
}
@@ -6806,6 +6810,7 @@ linuxkpi_ieee80211_iffree(struct ieee80211_hw *hw)
lkpi_80211_mo_remove_chanctx(hw, chanctx_conf);
}
list_del(&lchanctx->entry);
+ /* No need to reset the lchanctx here as we will free it below. */
list_add_rcu(&lchanctx->entry, &lhw->lchanctx_list_reserved);
}
}