]> git.hungrycats.org Git - linux/commitdiff
[PATCH] pcnet32: fix boundary comparison bug.
authorDon Fry <brazilnut@us.ibm.com>
Thu, 27 May 2004 09:03:48 +0000 (05:03 -0400)
committerJeff Garzik <jgarzik@redhat.com>
Thu, 27 May 2004 09:03:48 +0000 (05:03 -0400)
This patch fixes a boundary condition.  It is possible to get an
interrupt and have the transmit queue completely full.  Without this
the driver will leak skb's and pci maps (if the arch supports them).

drivers/net/pcnet32.c

index 72938087cc51c82af4500d16cdea2ffe5a30c2ad..08350723f70510a32c5d03e42119a53181c8a4c4 100644 (file)
@@ -1833,7 +1833,7 @@ pcnet32_interrupt(int irq, void *dev_id, struct pt_regs * regs)
            }
 
            delta = (lp->cur_tx - dirty_tx) & (TX_RING_MOD_MASK + TX_RING_SIZE);
-           if (delta >= TX_RING_SIZE) {
+           if (delta > TX_RING_SIZE) {
                if (netif_msg_drv(lp))
                    printk(KERN_ERR "%s: out-of-sync dirty pointer, %d vs. %d, full=%d.\n",
                            dev->name, dirty_tx, lp->cur_tx, lp->tx_full);