bnx2: Fix bug in bnx2_free_tx_skbs().
authorMichael Chan <mchan@broadcom.com>
Tue, 10 Jul 2012 10:04:40 +0000 (10:04 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Aug 2012 15:31:41 +0000 (08:31 -0700)
commitaf8ca6ddbb2928d5fb26f0a78710971e1210a299
treed25220dfac1ad1627388cc19fd4047480b16e415
parenta5b4b62d8517f12c77f912b8c249e36019d31a0c
bnx2: Fix bug in bnx2_free_tx_skbs().

[ Upstream commit c1f5163de417dab01fa9daaf09a74bbb19303f3c ]

In rare cases, bnx2x_free_tx_skbs() can unmap the wrong DMA address
when it gets to the last entry of the tx ring.  We were not using
the proper macro to skip the last entry when advancing the tx index.

Reported-by: Zongyun Lai <zlai@vmware.com>
Reviewed-by: Jeffrey Huang <huangjw@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/broadcom/bnx2.c