Commit c1f5163d authored by Michael Chan's avatar Michael Chan Committed by David S. Miller
Browse files

bnx2: Fix bug in bnx2_free_tx_skbs().

In rare cases, bnx2x_free_tx_skbs() can unmap the wrong DMA address
when it gets to the last entry of the tx ring.  We were not using
the proper macro to skip the last entry when advancing the tx index.
Reported-by: default avatarZongyun Lai <>
Reviewed-by: default avatarJeffrey Huang <>
Signed-off-by: default avatarMichael Chan <>
Signed-off-by: default avatarDavid S. Miller <>
parent b28ba726
......@@ -5372,7 +5372,7 @@ bnx2_free_tx_skbs(struct bnx2 *bp)
int k, last;
if (skb == NULL) {
j = NEXT_TX_BD(j);
......@@ -5384,8 +5384,8 @@ bnx2_free_tx_skbs(struct bnx2 *bp)
tx_buf->skb = NULL;
last = tx_buf->nr_frags;
for (k = 0; k < last; k++, j++) {
j = NEXT_TX_BD(j);
for (k = 0; k < last; k++, j = NEXT_TX_BD(j)) {
tx_buf = &txr->tx_buf_ring[TX_RING_IDX(j)];
dma_unmap_addr(tx_buf, mapping),
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment