diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c index ab7c5e97ed02..f588e49c65f1 100644 --- a/drivers/net/igb/igb_main.c +++ b/drivers/net/igb/igb_main.c @@ -3647,14 +3647,12 @@ static inline int igb_tx_map_adv(struct igb_ring *tx_ring, struct sk_buff *skb, buffer_info->length = 0; buffer_info->next_to_watch = 0; buffer_info->mapped_as_page = false; - count--; /* clear timestamp and dma mappings for remaining portion of packet */ - while (count >= 0) { - count--; + while (count--) { + if (i == 0) + i = tx_ring->count; i--; - if (i < 0) - i += tx_ring->count; buffer_info = &tx_ring->buffer_info[i]; igb_unmap_and_free_tx_resource(tx_ring, buffer_info); }