Commit dbbaf949 authored by Toshiaki Makita's avatar Toshiaki Makita Committed by David S. Miller

bridge: Call vlan_vid_del for all vids at nbp_vlan_flush

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: default avatarToshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 19236837
...@@ -390,6 +390,7 @@ int nbp_vlan_delete(struct net_bridge_port *port, u16 vid) ...@@ -390,6 +390,7 @@ int nbp_vlan_delete(struct net_bridge_port *port, u16 vid)
void nbp_vlan_flush(struct net_bridge_port *port) void nbp_vlan_flush(struct net_bridge_port *port)
{ {
struct net_port_vlans *pv; struct net_port_vlans *pv;
u16 vid;
ASSERT_RTNL(); ASSERT_RTNL();
...@@ -397,6 +398,9 @@ void nbp_vlan_flush(struct net_bridge_port *port) ...@@ -397,6 +398,9 @@ void nbp_vlan_flush(struct net_bridge_port *port)
if (!pv) if (!pv)
return; 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); __vlan_flush(pv);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment