]> Pileus Git - ~andy/linux/commitdiff
bridge: Call vlan_vid_del for all vids at nbp_vlan_flush
authorToshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
Wed, 13 Nov 2013 08:26:13 +0000 (17:26 +0900)
committerDavid S. Miller <davem@davemloft.net>
Thu, 14 Nov 2013 21:16:34 +0000 (16:16 -0500)
We should call vlan_vid_del for all vids at nbp_vlan_flush to prevent
vid_info->refcount from being leaked when detaching a bridge port.

Signed-off-by: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/bridge/br_vlan.c

index 57074be62fcbcb49ecdef2dc6118c9fae1e1380e..af5ebd18d7059f2d0cc289e226c544f210309dc2 100644 (file)
@@ -390,6 +390,7 @@ int nbp_vlan_delete(struct net_bridge_port *port, u16 vid)
 void nbp_vlan_flush(struct net_bridge_port *port)
 {
        struct net_port_vlans *pv;
+       u16 vid;
 
        ASSERT_RTNL();
 
@@ -397,6 +398,9 @@ void nbp_vlan_flush(struct net_bridge_port *port)
        if (!pv)
                return;
 
+       for_each_set_bit(vid, pv->vlan_bitmap, VLAN_N_VID)
+               vlan_vid_del(port->dev, htons(ETH_P_8021Q), vid);
+
        __vlan_flush(pv);
 }