From: Neil Turton Date: Wed, 23 Dec 2009 13:47:13 +0000 (+0000) Subject: sfc: Fix DMA mapping cleanup in case of an error in TSO X-Git-Tag: firefly_0821_release~11625^2~267 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=c97c73dead2d08a2e3eb2f84ad27b941deaef405;p=firefly-linux-kernel-4.4.55.git sfc: Fix DMA mapping cleanup in case of an error in TSO commit a7ebd27a13757248863cd61e541af7fa9e7727ee upstream. 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: Ben Hutchings Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/net/sfc/tx.c b/drivers/net/sfc/tx.c index 489c4de31447..d443ad7d8064 100644 --- a/drivers/net/sfc/tx.c +++ b/drivers/net/sfc/tx.c @@ -821,8 +821,6 @@ static void efx_enqueue_unwind(struct efx_tx_queue *tx_queue) tx_queue->efx->type->txd_ring_mask]; efx_tsoh_free(tx_queue, buffer); EFX_BUG_ON_PARANOID(buffer->skb); - buffer->len = 0; - buffer->continuation = true; if (buffer->unmap_len) { unmap_addr = (buffer->dma_addr + buffer->len - buffer->unmap_len); @@ -836,6 +834,8 @@ static void efx_enqueue_unwind(struct efx_tx_queue *tx_queue) PCI_DMA_TODEVICE); buffer->unmap_len = 0; } + buffer->len = 0; + buffer->continuation = true; } }