]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commit
[BNX2]: Fix panic in bnx2_tx_int().
authorMichael Chan <mchan@broadcom.com>
Thu, 14 Dec 2006 23:56:32 +0000 (15:56 -0800)
committerDavid S. Miller <davem@sunset.davemloft.net>
Mon, 18 Dec 2006 05:59:15 +0000 (21:59 -0800)
commitfaac9c4b753f420c02bdce0785d2657087830a12
treeb9f6aee28676bb22e1c4c12197797242024c03fa
parenta3d384029aa304f8f3f5355d35f0ae274454f7cd
[BNX2]: Fix panic in bnx2_tx_int().

There was an off-by-one bug in bnx2_tx_avail().  If the tx ring is
completely full, the producer and consumer indices may be apart by
256 even though the ring size is only 255.  One entry in the ring is
unused and must be properly accounted for when calculating the number
of available entries.  The bug caused the tx ring entries to be
reused by mistake, overwriting active entries, and ultimately causing
it to crash.

This bug rarely occurs because the tx ring is rarely completely full.
We always stop when there is less than MAX_SKB_FRAGS entries available
in the ring.

Thanks to Corey Kovacs <cjk@techma.com> and Andy Gospodarek
<agospoda@redhat.com> for reporting the problem and helping to collect
debug information.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/bnx2.c