summaryrefslogtreecommitdiffstats
path: root/drivers/net/sfc/tx.c
diff options
context:
space:
mode:
authorNeil Turton <nturton@solarflare.com>2009-12-23 14:47:13 +0100
committerDavid S. Miller <davem@davemloft.net>2009-12-24 04:09:05 +0100
commita7ebd27a13757248863cd61e541af7fa9e7727ee (patch)
tree0d49c2a37aed7f88dbe6cf4bf9f851901328d351 /drivers/net/sfc/tx.c
parentsfc: Include XGXS in XMAC link status check except in XGMII loopback (diff)
downloadlinux-a7ebd27a13757248863cd61e541af7fa9e7727ee.tar.xz
linux-a7ebd27a13757248863cd61e541af7fa9e7727ee.zip
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: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/sfc/tx.c')
-rw-r--r--drivers/net/sfc/tx.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/sfc/tx.c b/drivers/net/sfc/tx.c
index e669f94e821b..a8b70ef6d817 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)
EFX_TXQ_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;
}
}