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: firefly_0821_release~10186^2~1755 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=87ef9895abd28755732e599070d1ede1a1f90c27;p=firefly-linux-kernel-4.4.55.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 f590beafca1f..433f4dde9ea8 100644 --- a/drivers/net/e1000e/netdev.c +++ b/drivers/net/e1000e/netdev.c @@ -665,6 +665,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); }