* [PATCH 1/5] mwl8k: fix NULL pointer dereference on receive out-of-memory
@ 2009-08-03 19:58 Lennert Buytenhek
0 siblings, 0 replies; only message in thread
From: Lennert Buytenhek @ 2009-08-03 19:58 UTC (permalink / raw)
To: linville, linux-wireless; +Cc: nico
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>
---
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 a9a9704..f437fab 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;
--
1.5.6.4
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2009-08-03 19:58 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-03 19:58 [PATCH 1/5] mwl8k: fix NULL pointer dereference on receive out-of-memory Lennert Buytenhek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).