summaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorNeil Horman <nhorman@tuxdriver.com>2016-01-13 18:43:54 +0100
committerDavid S. Miller <davem@davemloft.net>2016-01-13 20:55:18 +0100
commit6e144419e4da11a9a4977c8d899d7247d94ca338 (patch)
treeeb889a7f8fe0385f6ba73029cf888ebd2c8bb273 /drivers/net
parent3c59x: balance page maps and unmaps (diff)
downloadlinux-6e144419e4da11a9a4977c8d899d7247d94ca338.tar.xz
linux-6e144419e4da11a9a4977c8d899d7247d94ca338.zip
3c59x: fix another page map/single unmap imbalance
libdma debug found another page map/unmap imbalance in 3c59x. Multi fragment frames are mapped such that the lead fragment was mapped as a single entry, while all other fragments were mapped as pages. However, on unmapping they were all unmapped as pages. Fix is pretty easy, just unmap the lead frag as a single entry, and bump the for loop initalization up by one so that all subsequent frags get unmapped as pages Signed-off-by: Neil Horman <nhorman@tuxdriver.com> CC: "David S. Miller" <davem@davemloft.net> CC: Steffen Klassert <klassert@mathematik.tu-chemnitz.de> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/ethernet/3com/3c59x.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/net/ethernet/3com/3c59x.c b/drivers/net/ethernet/3com/3c59x.c
index 4c3bc3106716..79e1a0282163 100644
--- a/drivers/net/ethernet/3com/3c59x.c
+++ b/drivers/net/ethernet/3com/3c59x.c
@@ -2459,7 +2459,12 @@ boomerang_interrupt(int irq, void *dev_id)
struct sk_buff *skb = vp->tx_skbuff[entry];
#if DO_ZEROCOPY
int i;
- for (i=0; i<=skb_shinfo(skb)->nr_frags; i++)
+ pci_unmap_single(VORTEX_PCI(vp),
+ le32_to_cpu(vp->tx_ring[entry].frag[0].addr),
+ le32_to_cpu(vp->tx_ring[entry].frag[0].length),
+ PCI_DMA_TODEVICE);
+
+ for (i=1; i<=skb_shinfo(skb)->nr_frags; i++)
pci_unmap_page(VORTEX_PCI(vp),
le32_to_cpu(vp->tx_ring[entry].frag[i].addr),
le32_to_cpu(vp->tx_ring[entry].frag[i].length)&0xFFF,