]> git.baikalelectronics.ru Git - kernel.git/commit
net: calxedaxgmac: fix possible skb free before tx complete
authorRob Herring <rob.herring@calxeda.com>
Fri, 30 Aug 2013 21:49:22 +0000 (16:49 -0500)
committerDavid S. Miller <davem@davemloft.net>
Wed, 4 Sep 2013 02:21:15 +0000 (22:21 -0400)
commit3163cbca6b18cbe74f52c8846feaee99ce32d76f
treecf305dbbc642e118d61fa13d2865ef5b3a847df7
parentf23d0c92f5bee6816e7095862ccdc7935fe84798
net: calxedaxgmac: fix possible skb free before tx complete

The TX completion code may have freed an skb before the entire sg list
was transmitted. The DMA unmap calls for the fragments could also get
skipped. Now set the skb pointer on every entry in the ring, not just
the head of the sg list. We then use the FS (first segment) bit in the
descriptors to determine skb head vs. fragment.

This also fixes similar bug in xgmac_free_tx_skbufs where clean-up of
a sg list that wraps at the end of the ring buffer would not get
unmapped.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/calxeda/xgmac.c