Commit a7ebd27a authored by Neil Turton's avatar Neil Turton Committed by David S. Miller

sfc: Fix DMA mapping cleanup in case of an error in TSO

We need buffer->len to remain valid to work out the correct address to
be unmapped.  We therefore need to clear buffer->len after the unmap
operation.
Signed-off-by: default avatarBen Hutchings <bhutchings@solarflare.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a355020a
...@@ -821,8 +821,6 @@ static void efx_enqueue_unwind(struct efx_tx_queue *tx_queue) ...@@ -821,8 +821,6 @@ static void efx_enqueue_unwind(struct efx_tx_queue *tx_queue)
EFX_TXQ_MASK]; EFX_TXQ_MASK];
efx_tsoh_free(tx_queue, buffer); efx_tsoh_free(tx_queue, buffer);
EFX_BUG_ON_PARANOID(buffer->skb); EFX_BUG_ON_PARANOID(buffer->skb);
buffer->len = 0;
buffer->continuation = true;
if (buffer->unmap_len) { if (buffer->unmap_len) {
unmap_addr = (buffer->dma_addr + buffer->len - unmap_addr = (buffer->dma_addr + buffer->len -
buffer->unmap_len); buffer->unmap_len);
...@@ -836,6 +834,8 @@ static void efx_enqueue_unwind(struct efx_tx_queue *tx_queue) ...@@ -836,6 +834,8 @@ static void efx_enqueue_unwind(struct efx_tx_queue *tx_queue)
PCI_DMA_TODEVICE); PCI_DMA_TODEVICE);
buffer->unmap_len = 0; buffer->unmap_len = 0;
} }
buffer->len = 0;
buffer->continuation = true;
} }
} }
......
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