netfilter: invoke synchronize_rcu after set the _hook_ to NULL
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / net / 8021q / vlan_core.c
index 8a15eaadc4bd655c9969b0b19197a424d79aaa36..42ef36a85e69cd04bd00552dab331ecf5a84285f 100644 (file)
@@ -9,7 +9,7 @@ bool vlan_do_receive(struct sk_buff **skbp)
 {
        struct sk_buff *skb = *skbp;
        __be16 vlan_proto = skb->vlan_proto;
-       u16 vlan_id = skb->vlan_tci & VLAN_VID_MASK;
+       u16 vlan_id = vlan_tx_tag_get_id(skb);
        struct net_device *vlan_dev;
        struct vlan_pcpu_stats *rx_stats;
 
@@ -103,8 +103,11 @@ EXPORT_SYMBOL(vlan_dev_vlan_id);
 
 static struct sk_buff *vlan_reorder_header(struct sk_buff *skb)
 {
-       if (skb_cow(skb, skb_headroom(skb)) < 0)
+       if (skb_cow(skb, skb_headroom(skb)) < 0) {
+               kfree_skb(skb);
                return NULL;
+       }
+
        memmove(skb->data - ETH_HLEN, skb->data - VLAN_ETH_HLEN, 2 * ETH_ALEN);
        skb->mac_header += VLAN_HLEN;
        return skb;