xennet_tx_bug_gc can free the skb before we use it, so make sure we don't.
Signed-off-by: Keir Fraser <keir@xensource.com>
Signed-off-by: Jeremy Fitzhardinge <jeremy@xensource.com>
Cc: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
if (notify)
notify_remote_via_irq(np->netdev->irq);
+ np->stats.tx_bytes += skb->len;
+ np->stats.tx_packets++;
+
+ /* Note: It is not safe to access skb after xennet_tx_buf_gc()! */
xennet_tx_buf_gc(dev);
if (!netfront_tx_slot_available(np))
spin_unlock_irq(&np->tx_lock);
- np->stats.tx_bytes += skb->len;
- np->stats.tx_packets++;
-
return 0;
drop: