diff options
author | Amitkumar Karwar <akarwar@marvell.com> | 2014-02-18 15:41:55 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-03-23 21:38:13 -0700 |
commit | ef8f92b153230230d437e32573c0560bae9a8f13 (patch) | |
tree | 84265688711f7ee8ff5c4418523f45dc3d3299a6 /drivers/net/wireless | |
parent | 036a9770c1ab0fe8fc6af256c002319935145f13 (diff) |
mwifiex: add NULL check for PCIe Rx skb
commit bb8e6a1ee881d131e404f0f1f5e8dc9281002771 upstream.
We may get a NULL pointer here if skb allocation for Rx packet
was failed earlier.
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/net/wireless')
-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 20c9c4c7b0b2..1662b99dd148 100644 --- a/drivers/net/wireless/mwifiex/pcie.c +++ b/drivers/net/wireless/mwifiex/pcie.c @@ -1195,6 +1195,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); |