diff options
author | Dave Jones <davej@redhat.com> | 2009-06-22 01:42:30 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-06-22 01:42:30 -0400 |
commit | f6b24caaf933a466397915a08e30e885a32f905a (patch) | |
tree | 98095c87be1d741bd3ca0ccb5ee0ad6f776a564b /drivers/net/via-velocity.c | |
parent | 0314db69d7564859890ff75e3f71cb4079b29869 (diff) |
via-velocity: Fix velocity driver unmapping incorrect size.
When a packet is greater than ETH_ZLEN, we end up assigning the
boolean result of a comparison to the size we unmap.
Signed-off-by: Dave Jones <davej@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/via-velocity.c')
-rw-r--r-- | drivers/net/via-velocity.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/via-velocity.c b/drivers/net/via-velocity.c index b02f7adff5dc..3ba35956327a 100644 --- a/drivers/net/via-velocity.c +++ b/drivers/net/via-velocity.c | |||
@@ -1847,7 +1847,7 @@ static void velocity_free_tx_buf(struct velocity_info *vptr, struct velocity_td_ | |||
1847 | */ | 1847 | */ |
1848 | if (tdinfo->skb_dma) { | 1848 | if (tdinfo->skb_dma) { |
1849 | 1849 | ||
1850 | pktlen = (skb->len > ETH_ZLEN ? : ETH_ZLEN); | 1850 | pktlen = max_t(unsigned int, skb->len, ETH_ZLEN); |
1851 | for (i = 0; i < tdinfo->nskb_dma; i++) { | 1851 | for (i = 0; i < tdinfo->nskb_dma; i++) { |
1852 | #ifdef VELOCITY_ZERO_COPY_SUPPORT | 1852 | #ifdef VELOCITY_ZERO_COPY_SUPPORT |
1853 | pci_unmap_single(vptr->pdev, tdinfo->skb_dma[i], le16_to_cpu(td->tdesc1.len), PCI_DMA_TODEVICE); | 1853 | pci_unmap_single(vptr->pdev, tdinfo->skb_dma[i], le16_to_cpu(td->tdesc1.len), PCI_DMA_TODEVICE); |