Skip to contentSkip to conversation

wifi: mwifiex: fix endianness handling in mwifiex_send_rgpower_table

PATCH In review Stefan Kerkmann 2 participants 2 messages Sep 10, 2025 Marvell mwifiex wireless driver

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 wifi: mwifiex: fix endianness handling in mwifiex_send_rgpower_table

The length of the host command is a u16 stored in little endian byte order, which needs byte order conversion to work correctly on big endian systems.

Fixes 7b6f16a25806 ("wifi: mwifiex: add rgpower table loading support")
---
 drivers/net/wireless/marvell/mwifiex/sta_cmd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/marvell/mwifiex/sta_cmd.c +1 -1
index 91d5098081e8b97420322484a229654c026e4618..dcca71158fc682902c0bd3376da32e81f8f6561f 100644
@@ -1537,7 +1537,7 @@ int mwifiex_send_rgpower_table(struct mwifiex_private *priv, const u8 *data,
 		}
 
 		if (*pos == '}' && start_raw) {
-			memcpy(&hostcmd->len, &hostcmd->cmd[2], sizeof(u16));
+			hostcmd->len = get_unaligned_le16(&hostcmd->cmd[2]);
 			ret = mwifiex_send_cmd(priv, 0, 0, 0, hostcmd, false);
 			if (ret) {
 				mwifiex_dbg(adapter, ERROR,

---
base-commit: e3ac93e9d916ebae0711a42f524429dad89c4887
change-id: 20250910-for-next-008ed8e8a74e

Best regards,

Signature · 1 line
Stefan Kerkmann <[email protected]>
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Stefan Kerkmann

The length of the host command is a u16 stored in little endian byte order, which needs byte order conversion to work correctly on big endian systems.

Fixes 7b6f16a25806 ("wifi: mwifiex: add rgpower table loading support")