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.33.3~25 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=d69ac822016964c25bfbdcad165668f22d058390;p=karo-tx-linux.git e1000e: stop cleaning when we reach tx_ring->next_to_use commit dac876193cd79ced36d0462749ea47c05844fb49 upstream. 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 Cc: Matthew Burgess Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c index 57f149b75fbe..4d353d25d60b 100644 --- a/drivers/net/e1000e/netdev.c +++ b/drivers/net/e1000e/netdev.c @@ -660,6 +660,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); }