Skip to content

Commit

Permalink
bridge: Call vlan_vid_del for all vids at nbp_vlan_flush
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Toshiaki Makita authored and David S. Miller committed Nov 14, 2013
1 parent 1923683 commit dbbaf94
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions net/bridge/br_vlan.c
Original file line number Diff line number Diff line change
Expand Up @@ -390,13 +390,17 @@ 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();

pv = rtnl_dereference(port->vlan_info);
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);
}

Expand Down

0 comments on commit dbbaf94

Please sign in to comment.