• Rob Herring's avatar
    net: calxedaxgmac: fix possible skb free before tx complete · 1a1d4d2f
    Rob Herring authored
    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: default avatarRob Herring <rob.herring@calxeda.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    1a1d4d2f
xgmac.c 54.9 KB