[PATCH v4 2/3] wifi: nxpwifi: read the 11AX_CFG extension ID at the right offset

From: Yehyeong Lee

Date: Mon Oct 19 2026 - 20:51:29 EST


The send side writes the extension ID as the first payload byte of the
TLV in nxpwifi_cmd_11ax_cfg(), but nxpwifi_ret_11ax_cfg() reads it one
byte later and copies the HE capability from the same wrong offset. The
capability test runs on the wrong byte and the copy reads one byte past
the declared payload.

Read the extension ID and copy the capability from the first payload
byte. A zero-length extension TLV has no payload to read an extension ID
out of, so skip it.

Fixes: 73b01e57ed3e ("wifi: nxp: add nxpwifi driver for IW61x")
Signed-off-by: Yehyeong Lee <yhlee@xxxxxxxxxxxxxxxxxx>
---
drivers/net/wireless/nxp/nxpwifi/11ax.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/nxp/nxpwifi/11ax.c b/drivers/net/wireless/nxp/nxpwifi/11ax.c
index 7e9127ae2f421..16bda167fa66b 100644
--- a/drivers/net/wireless/nxp/nxpwifi/11ax.c
+++ b/drivers/net/wireless/nxp/nxpwifi/11ax.c
@@ -219,13 +219,13 @@ int nxpwifi_ret_11ax_cfg(struct nxpwifi_private *priv,
tlv_type = le16_to_cpu(header->type);
tlv_len = le16_to_cpu(header->len);

- if (tlv_type == TLV_TYPE_EXTENSION_ID) {
- ext_id = *((u8 *)header + sizeof(*header) + 1);
+ if (tlv_type == TLV_TYPE_EXTENSION_ID && tlv_len >= 1) {
+ ext_id = *((u8 *)header + sizeof(*header));
if (ext_id == WLAN_EID_EXT_HE_CAPABILITY) {
he_cap->id = tlv_type;
he_cap->len = tlv_len;
memcpy((u8 *)&he_cap->ext_id,
- (u8 *)header + sizeof(*header) + 1,
+ (u8 *)header + sizeof(*header),
tlv_len);
if (he_cfg->band_config & BIT(1)) {
memcpy(priv->user_he_cap,
--
2.43.0