Skip to content

Commit 1b2e9fe

Browse files
KarlK90jmberg-intel
authored andcommitted
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. Reported-by: Dan Carpenter <[email protected]> Closes: https://lore.kernel.org/linux-wireless/[email protected] Fixes: 7b6f16a ("wifi: mwifiex: add rgpower table loading support") Signed-off-by: Stefan Kerkmann <[email protected]> Reviewed-by: Francesco Dolcini <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Johannes Berg <[email protected]>
1 parent 6f4f8ab commit 1b2e9fe

File tree

1 file changed

+1
-1
lines changed
  • drivers/net/wireless/marvell/mwifiex

1 file changed

+1
-1
lines changed

drivers/net/wireless/marvell/mwifiex/sta_cmd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1537,7 +1537,7 @@ int mwifiex_send_rgpower_table(struct mwifiex_private *priv, const u8 *data,
15371537
}
15381538

15391539
if (*pos == '}' && start_raw) {
1540-
memcpy(&hostcmd->len, &hostcmd->cmd[2], sizeof(u16));
1540+
hostcmd->len = get_unaligned_le16(&hostcmd->cmd[2]);
15411541
ret = mwifiex_send_cmd(priv, 0, 0, 0, hostcmd, false);
15421542
if (ret) {
15431543
mwifiex_dbg(adapter, ERROR,

0 commit comments

Comments
 (0)