* [PATCH wireless-next 1/2] wifi: nxpwifi: fix inverted check in Tx BA stream entry deletion
2026-08-25 23:17 [PATCH wireless-next 0/2] wifi: nxpwifi: fix two block ack teardown bugs David Carlier
@ 2026-08-25 23:17 ` David Carlier
2026-08-25 23:17 ` [PATCH wireless-next 2/2] wifi: nxpwifi: do not delete Rx reorder entries under RCU David Carlier
1 sibling, 0 replies; 3+ messages in thread
From: David Carlier @ 2026-08-25 23:17 UTC (permalink / raw)
To: Jeff Chen
Cc: Francesco Dolcini, Johannes Berg, linux-wireless, linux-kernel,
David Carlier
nxpwifi_is_tx_ba_stream_ptr_valid() returns true when the entry is still
linked, and every caller passes an entry that is on the list, so the early
return always fires and nothing is ever unlinked or freed. Entries leak on
every teardown and, since nxpwifi_space_avail_for_new_ba_stream() counts
them, Tx aggregation stops being negotiated once the stale count reaches
the maximum.
Changing the original dead && test to || to silence a NULL dereference
report inverted the validity test along with it.
Fixes: 00c786a7581e ("wifi: nxpwifi: fix multiple static analysis errors and warnings")
Assisted-by: Claude:claude-opus-5
Signed-off-by: David Carlier <devnexen@gmail.com>
---
drivers/net/wireless/nxp/nxpwifi/11n.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/nxp/nxpwifi/11n.c b/drivers/net/wireless/nxp/nxpwifi/11n.c
index c2a54d781b42..25b2e430f3f9 100644
--- a/drivers/net/wireless/nxp/nxpwifi/11n.c
+++ b/drivers/net/wireless/nxp/nxpwifi/11n.c
@@ -451,7 +451,7 @@ void
nxpwifi_11n_delete_tx_ba_stream_tbl_entry(struct nxpwifi_private *priv,
struct nxpwifi_tx_ba_stream_tbl *tbl)
{
- if (!tbl || nxpwifi_is_tx_ba_stream_ptr_valid(priv, tbl))
+ if (!tbl || !nxpwifi_is_tx_ba_stream_ptr_valid(priv, tbl))
return;
nxpwifi_dbg(priv->adapter, INFO,
--
2.55.0
^ permalink raw reply related [flat|nested] 3+ messages in thread* [PATCH wireless-next 2/2] wifi: nxpwifi: do not delete Rx reorder entries under RCU
2026-08-25 23:17 [PATCH wireless-next 0/2] wifi: nxpwifi: fix two block ack teardown bugs David Carlier
2026-08-25 23:17 ` [PATCH wireless-next 1/2] wifi: nxpwifi: fix inverted check in Tx BA stream entry deletion David Carlier
@ 2026-08-25 23:17 ` David Carlier
1 sibling, 0 replies; 3+ messages in thread
From: David Carlier @ 2026-08-25 23:17 UTC (permalink / raw)
To: Jeff Chen
Cc: Francesco Dolcini, Johannes Berg, linux-wireless, linux-kernel,
David Carlier
The RCU guard is declared in the body of the per-TID loop, so it is still
held across the teardown pass. nxpwifi_del_rx_reorder_entry() flushes the
Rx workqueue and deletes the reorder timer synchronously, both of which
sleep, so a station deauthenticating from the AP splats under
CONFIG_DEBUG_ATOMIC_SLEEP.
Scope the guard to the collection walk. The teardown does not need RCU: it
serialises on priv->rx_reorder_tbl_lock[] and frees with kfree_rcu().
Fixes: 73b01e57ed3e ("wifi: nxp: add nxpwifi driver for IW61x")
Assisted-by: Claude:claude-opus-5
Signed-off-by: David Carlier <devnexen@gmail.com>
---
drivers/net/wireless/nxp/nxpwifi/11n_rxreorder.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/drivers/net/wireless/nxp/nxpwifi/11n_rxreorder.c b/drivers/net/wireless/nxp/nxpwifi/11n_rxreorder.c
index 65b628411543..87cf2ec85991 100644
--- a/drivers/net/wireless/nxp/nxpwifi/11n_rxreorder.c
+++ b/drivers/net/wireless/nxp/nxpwifi/11n_rxreorder.c
@@ -205,11 +205,12 @@ void nxpwifi_11n_del_rx_reorder_tbl_by_ta(struct nxpwifi_private *priv, u8 *ta)
return;
for (i = 0; i < MAX_NUM_TID; i++) {
- guard(rcu)();
- list_for_each_entry_rcu(tbl, &priv->rx_reorder_tbl_ptr[i], list) {
- if (!memcmp(tbl->ta, ta, ETH_ALEN)) {
- INIT_LIST_HEAD(&tbl->tmp_list);
- list_add_tail(&tbl->tmp_list, &to_delete);
+ scoped_guard(rcu) {
+ list_for_each_entry_rcu(tbl, &priv->rx_reorder_tbl_ptr[i], list) {
+ if (!memcmp(tbl->ta, ta, ETH_ALEN)) {
+ INIT_LIST_HEAD(&tbl->tmp_list);
+ list_add_tail(&tbl->tmp_list, &to_delete);
+ }
}
}
--
2.55.0
^ permalink raw reply related [flat|nested] 3+ messages in thread