vxlan: fix a free after use
[cascardo/linux.git] / drivers / net / xen-netfront.c
index 28204bc..3c0b375 100644 (file)
@@ -628,16 +628,17 @@ static int xennet_start_xmit(struct sk_buff *skb, struct net_device *dev)
        slots = DIV_ROUND_UP(offset + len, PAGE_SIZE) +
                xennet_count_skb_frag_slots(skb);
        if (unlikely(slots > MAX_SKB_FRAGS + 1)) {
-               net_alert_ratelimited(
-                       "xennet: skb rides the rocket: %d slots\n", slots);
-               goto drop;
+               net_dbg_ratelimited("xennet: skb rides the rocket: %d slots, %d bytes\n",
+                                   slots, skb->len);
+               if (skb_linearize(skb))
+                       goto drop;
        }
 
        spin_lock_irqsave(&queue->tx_lock, flags);
 
        if (unlikely(!netif_carrier_ok(dev) ||
                     (slots > 1 && !xennet_can_sg(dev)) ||
-                    netif_needs_gso(skb, netif_skb_features(skb)))) {
+                    netif_needs_gso(dev, skb, netif_skb_features(skb)))) {
                spin_unlock_irqrestore(&queue->tx_lock, flags);
                goto drop;
        }