Merge tag 'v3.10.98' into update
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / net / bridge / br_vlan.c
index bd58b45f5f901fd4c6a3ad00abe068baeba8d898..d8deb8bda7364e5244461d56615f071fbe72f574 100644 (file)
@@ -108,7 +108,7 @@ static int __vlan_del(struct net_port_vlans *v, u16 vid)
 
        clear_bit(vid, v->vlan_bitmap);
        v->num_vlans--;
-       if (bitmap_empty(v->vlan_bitmap, BR_VLAN_BITMAP_LEN)) {
+       if (bitmap_empty(v->vlan_bitmap, VLAN_N_VID)) {
                if (v->port_idx)
                        rcu_assign_pointer(v->parent.port->vlan_info, NULL);
                else
@@ -122,7 +122,7 @@ static void __vlan_flush(struct net_port_vlans *v)
 {
        smp_wmb();
        v->pvid = 0;
-       bitmap_zero(v->vlan_bitmap, BR_VLAN_BITMAP_LEN);
+       bitmap_zero(v->vlan_bitmap, VLAN_N_VID);
        if (v->port_idx)
                rcu_assign_pointer(v->parent.port->vlan_info, NULL);
        else
@@ -202,7 +202,7 @@ bool br_allowed_ingress(struct net_bridge *br, struct net_port_vlans *v,
         * rejected.
         */
        if (!v)
-               return false;
+               goto drop;
 
        if (br_vlan_get_tag(skb, vid)) {
                u16 pvid = br_get_pvid(v);
@@ -212,7 +212,7 @@ bool br_allowed_ingress(struct net_bridge *br, struct net_port_vlans *v,
                 * traffic belongs to.
                 */
                if (pvid == VLAN_N_VID)
-                       return false;
+                       goto drop;
 
                /* PVID is set on this port.  Any untagged ingress
                 * frame is considered to belong to this vlan.
@@ -224,7 +224,8 @@ bool br_allowed_ingress(struct net_bridge *br, struct net_port_vlans *v,
        /* Frame had a valid vlan tag.  See if vlan is allowed */
        if (test_bit(*vid, v->vlan_bitmap))
                return true;
-
+drop:
+       kfree_skb(skb);
        return false;
 }