diff options
author | Terry Loftin <terry.loftin@hp.com> | 2010-04-09 06:29:49 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-04-26 10:48:02 -0400 |
commit | d69ac822016964c25bfbdcad165668f22d058390 (patch) | |
tree | f20fd80c62f01ad9a052d2c1c3e5da3aab78fbc4 | |
parent | 6722260b066a1de80228d71da99ab71ebdcc7ae8 (diff) |
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 <terry.loftin@hp.com>
Acked-by: Bruce Allan <bruce.w.allan@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Cc: Matthew Burgess <matthew@linuxfromscratch.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | drivers/net/e1000e/netdev.c | 2 |
1 files changed, 2 insertions, 0 deletions
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) | |||
660 | i = 0; | 660 | i = 0; |
661 | } | 661 | } |
662 | 662 | ||
663 | if (i == tx_ring->next_to_use) | ||
664 | break; | ||
663 | eop = tx_ring->buffer_info[i].next_to_watch; | 665 | eop = tx_ring->buffer_info[i].next_to_watch; |
664 | eop_desc = E1000_TX_DESC(*tx_ring, eop); | 666 | eop_desc = E1000_TX_DESC(*tx_ring, eop); |
665 | } | 667 | } |