mwifiex: fix scan problem on big endian platforms
authorAmitkumar Karwar <akarwar@marvell.com>
Tue, 25 Nov 2014 14:43:03 +0000 (06:43 -0800)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 25 Nov 2014 19:09:56 +0000 (14:09 -0500)
This patch adds missing endian conversion for beacon size while
processing scan response.

Reported-by: Daniel Mosquera <daniel.mosquera@ctag.com>
Tested-by: Daniel Mosquera <daniel.mosquera@ctag.com>
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/mwifiex/scan.c

index 3a17821157d77c1503ab636fafc8d244ae538def..984a7a4fa93b4920600255ec79966b3ab5272e49 100644 (file)
@@ -1623,7 +1623,7 @@ mwifiex_parse_single_response_buf(struct mwifiex_private *priv, u8 **bss_info,
 
        if (*bytes_left >= sizeof(beacon_size)) {
                /* Extract & convert beacon size from command buffer */
-               memcpy(&beacon_size, *bss_info, sizeof(beacon_size));
+               beacon_size = le16_to_cpu(*(__le16 *)(*bss_info));
                *bytes_left -= sizeof(beacon_size);
                *bss_info += sizeof(beacon_size);
        }