tg3: Fix 4k tx bd segmentation code
authorMatt Carlson <mcarlson@broadcom.com>
Fri, 4 Nov 2011 09:14:59 +0000 (09:14 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 4 Nov 2011 21:31:47 +0000 (17:31 -0400)
commitb9e454826f22e17d1945bd282834c87aef8d0f95
treee90abb4a6f8bc8bdb67b1b4bacd030bfad15b9ed
parent78f94dc7b10d98cf4cf8498d98581500d910c6b7
tg3: Fix 4k tx bd segmentation code

The new 4k tx bd segmentation code had a bug in the error cleanup path.
If the driver did not map all the physical fragments, the abort path
would wind up advancing the producer index beyond the point where the
setup code stopped.  This would ultimately turn into a tx recovery error
where the driver would expect the skb pointer to be set when it isn't.
This patch fixes the problem, and then makes the code a little easier to
understand.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/tg3.c