Browse Source

check len on cmd complete

Jake Day 8 years ago
parent
commit
bb23bd6b66
1 changed files with 10 additions and 0 deletions
  1. 10 0
      drivers/net/wireless/marvell/mwifiex/pcie.c

+ 10 - 0
drivers/net/wireless/marvell/mwifiex/pcie.c

@@ -1716,6 +1716,16 @@ static int mwifiex_pcie_process_cmd_complete(struct mwifiex_adapter *adapter)
 	}
 
 	rx_len = get_unaligned_le16(skb->data);
+
+
+	if (rx_len == 0) {
+		mwifiex_dbg(adapter, ERROR,
+				    "0 byte cmdrsp\n");
+		mwifiex_map_pci_memory(adapter, skb, MWIFIEX_UPLD_SIZE,
+					   PCI_DMA_FROMDEVICE);
+		return 0;
+	}
+
 	skb_put(skb, MWIFIEX_UPLD_SIZE - skb->len);
 	skb_trim(skb, rx_len);