]> git.baikalelectronics.ru Git - kernel.git/commit
net: stmmac: free an skb first when there are no longer any descriptors using it
authorNiklas Cassel <niklas.cassel@axis.com>
Tue, 20 Jun 2017 12:32:41 +0000 (14:32 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 20 Jun 2017 19:41:00 +0000 (15:41 -0400)
commit3e7e0dbfa656b39d595623543aab7dd75773cd89
tree17f1e6c46f6da8e830f3e13ac1edd17d49246978
parente6c729e10bce2c3a1a168d12a84890d2ee38a9af
net: stmmac: free an skb first when there are no longer any descriptors using it

When having the skb pointer in the first descriptor, stmmac_tx_clean
can get called at a moment where the IP has only cleared the own bit
of the first descriptor, thus freeing the skb, even though there can
be several descriptors whose buffers point into the same skb.

By simply moving the skb pointer from the first descriptor to the last
descriptor, a skb will get freed only when the IP has cleared the
own bit of all the descriptors that are using that skb.

Signed-off-by: Niklas Cassel <niklas.cassel@axis.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c