From 211cb274b50a3cfc750af1de4596ac4b679b646d Mon Sep 17 00:00:00 2001 From: Viacheslav Bocharov Date: Thu, 20 Aug 2026 19:09:02 +0300 Subject: [PATCH 1/2] os_intfs: make the rx_ampdu sz_limit branch chain exhaustive gcc W=2 cannot prove the else-if chain covers i == 3 and reports sz_limit maybe-uninitialized; make the last branch a plain else. No behavior change (i < 4). --- os_dep/linux/os_intfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/os_dep/linux/os_intfs.c b/os_dep/linux/os_intfs.c index 65b6ed9..76f0355 100644 --- a/os_dep/linux/os_intfs.c +++ b/os_dep/linux/os_intfs.c @@ -1089,7 +1089,7 @@ inline void rtw_regsty_init_rx_ampdu_sz_limit(struct registry_priv *regsty) sz_limit = rtw_rx_ampdu_sz_limit_2ss; else if (i == 2) sz_limit = rtw_rx_ampdu_sz_limit_3ss; - else if (i == 3) + else sz_limit = rtw_rx_ampdu_sz_limit_4ss; for (j = 0; j < 4; j++) From 434fa83ed0ba6de9c90bf03e756d7d9a480503a0 Mon Sep 17 00:00:00 2001 From: Viacheslav Bocharov Date: Mon, 24 Aug 2026 16:40:45 +0300 Subject: [PATCH 2/2] os_intfs: warn and skip an unexpected nss index instead of mapping it to 4ss Keep the i == 3 arm explicit; an out-of-range index (possible only via a future edit of the loop) trips rtw_warn_on() and skips the row instead of silently reusing the 4ss limits. --- os_dep/linux/os_intfs.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/os_dep/linux/os_intfs.c b/os_dep/linux/os_intfs.c index 76f0355..dd65e2f 100644 --- a/os_dep/linux/os_intfs.c +++ b/os_dep/linux/os_intfs.c @@ -1089,8 +1089,12 @@ inline void rtw_regsty_init_rx_ampdu_sz_limit(struct registry_priv *regsty) sz_limit = rtw_rx_ampdu_sz_limit_2ss; else if (i == 2) sz_limit = rtw_rx_ampdu_sz_limit_3ss; - else + else if (i == 3) sz_limit = rtw_rx_ampdu_sz_limit_4ss; + else { + rtw_warn_on(1); + continue; + } for (j = 0; j < 4; j++) regsty->rx_ampdu_sz_limit_by_nss_bw[i][j] = sz_limit[j];