diff options
author | Lennert Buytenhek <buytenh@wantstofly.org> | 2009-08-03 15:58:26 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-08-07 13:09:29 -0400 |
commit | d25f9f1357139bbdc79bc960ea84909a7c22ec2b (patch) | |
tree | 1224be30813c2af7b0449d1046f2e12c91b16f41 /drivers/net/wireless | |
parent | 7dd2459d8f7a967bcd1466591aec72bb3ddc07cc (diff) |
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')
-rw-r--r-- | drivers/net/wireless/mwl8k.c | 2 |
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) | |||
1012 | rmb(); | 1012 | rmb(); |
1013 | 1013 | ||
1014 | skb = rxq->rx_skb[rxq->rx_head]; | 1014 | skb = rxq->rx_skb[rxq->rx_head]; |
1015 | if (skb == NULL) | ||
1016 | break; | ||
1015 | rxq->rx_skb[rxq->rx_head] = NULL; | 1017 | rxq->rx_skb[rxq->rx_head] = NULL; |
1016 | 1018 | ||
1017 | rxq->rx_head = (rxq->rx_head + 1) % MWL8K_RX_DESCS; | 1019 | rxq->rx_head = (rxq->rx_head + 1) % MWL8K_RX_DESCS; |