From: Amitkumar Karwar Date: Wed, 22 Jul 2015 11:53:45 +0000 (-0700) Subject: mwifiex: corrections in PCIe event skb handling X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=2728cecdc7d6bf3d216fc406718d88c35f4d09eb;p=openwrt%2Fstaging%2Fblogic.git mwifiex: corrections in PCIe event skb handling Preallocated event SKBs are getting reused for PCIe chipset. Their physical addresses are shared with firmware so that firmware can write data into them. This patch makes sure that SKB is cleared and length is set to default while submitting it to firmware. Signed-off-by: Amitkumar Karwar Signed-off-by: Zhaoyang Liu Signed-off-by: Kalle Valo --- diff --git a/drivers/net/wireless/mwifiex/pcie.c b/drivers/net/wireless/mwifiex/pcie.c index 77b9055a2d14..33c75d741017 100644 --- a/drivers/net/wireless/mwifiex/pcie.c +++ b/drivers/net/wireless/mwifiex/pcie.c @@ -1807,6 +1807,8 @@ static int mwifiex_pcie_event_complete(struct mwifiex_adapter *adapter, if (!card->evt_buf_list[rdptr]) { skb_push(skb, INTF_HEADER_LEN); + skb_put(skb, MAX_EVENT_SIZE - skb->len); + memset(skb->data, 0, MAX_EVENT_SIZE); if (mwifiex_map_pci_memory(adapter, skb, MAX_EVENT_SIZE, PCI_DMA_FROMDEVICE))