diff options
author | Amitkumar Karwar <akarwar@marvell.com> | 2014-02-18 23:41:55 (GMT) |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2014-02-20 20:53:20 (GMT) |
commit | bb8e6a1ee881d131e404f0f1f5e8dc9281002771 (patch) | |
tree | f496b74a02647dfab915966ac73032a32ff80192 /drivers | |
parent | 4f7ba432202c8330cc03ab959c6228d0de5dc4a3 (diff) | |
download | linux-bb8e6a1ee881d131e404f0f1f5e8dc9281002771.tar.xz |
mwifiex: add NULL check for PCIe Rx skb
We may get a NULL pointer here if skb allocation for Rx packet
was failed earlier.
Cc: <stable@vger.kernel.org> # 3.9+
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/mwifiex/pcie.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/net/wireless/mwifiex/pcie.c b/drivers/net/wireless/mwifiex/pcie.c index 03688aa..28029b7 100644 --- a/drivers/net/wireless/mwifiex/pcie.c +++ b/drivers/net/wireless/mwifiex/pcie.c @@ -1211,6 +1211,12 @@ static int mwifiex_pcie_process_recv_data(struct mwifiex_adapter *adapter) rd_index = card->rxbd_rdptr & reg->rx_mask; skb_data = card->rx_buf_list[rd_index]; + /* If skb allocation was failed earlier for Rx packet, + * rx_buf_list[rd_index] would have been left with a NULL. + */ + if (!skb_data) + return -ENOMEM; + MWIFIEX_SKB_PACB(skb_data, &buf_pa); pci_unmap_single(card->dev, buf_pa, MWIFIEX_RX_DATA_BUF_SIZE, PCI_DMA_FROMDEVICE); |