summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mwl8k.c
diff options
context:
space:
mode:
authorLennert Buytenhek2009-08-03 21:58:26 +0200
committerJohn W. Linville2009-08-07 19:09:29 +0200
commitd25f9f1357139bbdc79bc960ea84909a7c22ec2b (patch)
tree1224be30813c2af7b0449d1046f2e12c91b16f41 /drivers/net/wireless/mwl8k.c
parentipw2x00: Write outside array bounds (diff)
downloadkernel-qcow2-linux-d25f9f1357139bbdc79bc960ea84909a7c22ec2b.tar.gz
kernel-qcow2-linux-d25f9f1357139bbdc79bc960ea84909a7c22ec2b.tar.xz
kernel-qcow2-linux-d25f9f1357139bbdc79bc960ea84909a7c22ec2b.zip
mwl8k: fix NULL pointer dereference on receive out-of-memory
When we go into out-of-memory and fail to allocate skbuffs to refill the receive ring with, rxq_process can end up running into a receive ring entry that is marked as host-owned but doesn't have an associated skbuff. If this happens, we must break out of the rx processing loop instead of trying to process the descriptor. Signed-off-by: Lennert Buytenhek <buytenh@marvell.com> Acked-by: Nicolas Pitre <nico@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/mwl8k.c')
-rw-r--r--drivers/net/wireless/mwl8k.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/wireless/mwl8k.c b/drivers/net/wireless/mwl8k.c
index a263d5c84c08..71f3eb67981e 100644
--- a/drivers/net/wireless/mwl8k.c
+++ b/drivers/net/wireless/mwl8k.c
@@ -1012,6 +1012,8 @@ static int rxq_process(struct ieee80211_hw *hw, int index, int limit)
rmb();
skb = rxq->rx_skb[rxq->rx_head];
+ if (skb == NULL)
+ break;
rxq->rx_skb[rxq->rx_head] = NULL;
rxq->rx_head = (rxq->rx_head + 1) % MWL8K_RX_DESCS;