From: Terry Loftin Date: Fri, 9 Apr 2010 10:29:49 +0000 (+0000) Subject: e1000e: stop cleaning when we reach tx_ring->next_to_use X-Git-Tag: v2.6.34-rc5~25^2~2 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=dac876193cd79ced36d0462749ea47c05844fb49;p=karo-tx-linux.git e1000e: stop cleaning when we reach tx_ring->next_to_use Tx ring buffers after tx_ring->next_to_use are volatile and could change, possibly causing a crash. Stop cleaning when we hit tx_ring->next_to_use. Signed-off-by: Terry Loftin Acked-by: Bruce Allan Signed-off-by: Jeff Kirsher Signed-off-by: David S. Miller --- diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c index cfd09cea7214..73d43c53015a 100644 --- a/drivers/net/e1000e/netdev.c +++ b/drivers/net/e1000e/netdev.c @@ -661,6 +661,8 @@ static bool e1000_clean_tx_irq(struct e1000_adapter *adapter) i = 0; } + if (i == tx_ring->next_to_use) + break; eop = tx_ring->buffer_info[i].next_to_watch; eop_desc = E1000_TX_DESC(*tx_ring, eop); }