datapath: Simplify vport_send() error handling.
[cascardo/ovs.git] / datapath / linux / compat / vxlan.c
index b9fd8ba..0389b28 100644 (file)
@@ -187,8 +187,10 @@ int vxlan_xmit_skb(struct vxlan_sock *vs,
 
        /* Need space for new headers (invalidates iph ptr) */
        err = skb_cow_head(skb, min_headroom);
-       if (unlikely(err))
+       if (unlikely(err)) {
+               kfree_skb(skb);
                return err;
+       }
 
        if (vlan_tx_tag_present(skb)) {
                if (unlikely(!__vlan_put_tag(skb,
@@ -219,7 +221,7 @@ int vxlan_xmit_skb(struct vxlan_sock *vs,
 
        skb = handle_offloads(skb);
        if (IS_ERR(skb))
-               return 0;
+               return PTR_ERR(skb);
 
        return iptunnel_xmit(vs->sock->sk, rt, skb, src, dst, IPPROTO_UDP,
                             tos, ttl, df, false);