via-velocity: Fix velocity driver unmapping incorrect size.
authorDave Jones <davej@redhat.com>
Mon, 22 Jun 2009 05:42:30 +0000 (22:42 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 22 Jun 2009 05:42:30 +0000 (22:42 -0700)
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>
drivers/net/via-velocity.c

index b02f7adff5dcef08f6889ba7ef7da8d5a4e34400..3ba35956327a37a4cb74046c39e18762f6659ccd 100644 (file)
@@ -1847,7 +1847,7 @@ static void velocity_free_tx_buf(struct velocity_info *vptr, struct velocity_td_
         */
        if (tdinfo->skb_dma) {
 
-               pktlen = (skb->len > ETH_ZLEN ? : ETH_ZLEN);
+               pktlen = max_t(unsigned int, skb->len, ETH_ZLEN);
                for (i = 0; i < tdinfo->nskb_dma; i++) {
 #ifdef VELOCITY_ZERO_COPY_SUPPORT
                        pci_unmap_single(vptr->pdev, tdinfo->skb_dma[i], le16_to_cpu(td->tdesc1.len), PCI_DMA_TODEVICE);