[PATCH RESEND rtw-next v2 0/2] wifi: rtw88: 8822c: check register values in cck_pd_set

From: Zeshan Ahmed Nobin

Date: Sun Nov 08 2026 - 13:29:56 EST


rtw8822c_phy_cck_pd_set() indexes its tables with two values read from
the chip, bw and nrx, without checking them first. When the chip stops
responding, both can be out of range. Patch 1 handles bw, which goes out
of range when an RTL8822CE drops off the PCIe bus. Patch 2 handles nrx,
which Luka Gejak found while reviewing v1.

v2:
- Patch 1: move the test data below the --- line (Luka)
- Patch 1: use the preferred multi-line comment style (Luka)
- Patch 1: drop the nrx check, which can never be true (Luka)
- Patch 2: new

v1: https://lore.kernel.org/linux-wireless/20261105113415.73184-1-zeshanahmednobin@xxxxxxxxx/

AI assistance: I asked an AI coding assistant to help find out why the
RTL8822CE in my laptop keeps failing. It analyzed the kernel logs and
found the bw bug (Luka found the nrx one), wrote both fixes, the
debug-only changes used for testing, and the messages. I reviewed
everything and ran the tests described in each patch before sending.

Zeshan Ahmed Nobin (2):
wifi: rtw88: 8822c: fix out-of-bounds access in cck_pd_set
wifi: rtw88: 8822c: ignore nrx values without CCK PD registers

drivers/net/wireless/realtek/rtw88/rtw8822c.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)


base-commit: dc16902cad9c6b08df9395a510c7be44fbab545d
--
2.43.0