tg3: Fix tg3_skb_error_unmap()
authorMatt Carlson <mcarlson@broadcom.com>
Thu, 2 Jun 2011 13:01:39 +0000 (13:01 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 3 Jun 2011 07:01:30 +0000 (00:01 -0700)
This function attempts to free one fragment beyond the number of
fragments that were actually mapped.  This patch brings back the limit
to the correct spot.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Tested-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/tg3.c

index f4b01c638a330d969ab32f88178bc51ab7eebf73..a1f9f9eef37d3b04b8d1344c964eec0a57c56eb2 100644 (file)
@@ -5774,7 +5774,7 @@ static void tg3_skb_error_unmap(struct tg3_napi *tnapi,
                         dma_unmap_addr(txb, mapping),
                         skb_headlen(skb),
                         PCI_DMA_TODEVICE);
-       for (i = 0; i <= last; i++) {
+       for (i = 0; i < last; i++) {
                skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
 
                entry = NEXT_TX(entry);