mwifiex: update command response skb length correctly
authorAmitkumar Karwar <akarwar@marvell.com>
Fri, 15 Jul 2016 13:37:05 +0000 (19:07 +0530)
committerKalle Valo <kvalo@codeaurora.org>
Mon, 18 Jul 2016 19:42:57 +0000 (22:42 +0300)
Same skb is being reused for storing command response from firmware
in PCIe chipsets. There was a bug while updating the skb length.
This patch ensures skb length correctly gets updated based on rx_len.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/marvell/mwifiex/pcie.c

index 12d0ee15df1f7be7dc9078c6ea251a25e349e6a2..453ab6ad478466c9a1fdf53cb14b3047ef9d92c2 100644 (file)
@@ -1616,6 +1616,7 @@ static int mwifiex_pcie_process_cmd_complete(struct mwifiex_adapter *adapter)
 
        pkt_len = *((__le16 *)skb->data);
        rx_len = le16_to_cpu(pkt_len);
+       skb_put(skb, MWIFIEX_UPLD_SIZE - skb->len);
        skb_trim(skb, rx_len);
        skb_pull(skb, INTF_HEADER_LEN);