diff options
author | Amitkumar Karwar <akarwar@marvell.com> | 2014-02-18 15:41:55 -0800 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2014-02-20 15:53:20 -0500 |
commit | bb8e6a1ee881d131e404f0f1f5e8dc9281002771 (patch) | |
tree | f496b74a02647dfab915966ac73032a32ff80192 /drivers/net | |
parent | 4f7ba432202c8330cc03ab959c6228d0de5dc4a3 (diff) | |
download | linux-bb8e6a1ee881d131e404f0f1f5e8dc9281002771.tar.bz2 |
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/net')
-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 03688aa14e8a..28029b7522c2 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); |