diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c index 44853cc2d9be91ddbb81fd028f2dd46d431b0b85..6d346347c9d379b88f83311c451e1d92399c7710 100644 --- a/drivers/net/macvlan.c +++ b/drivers/net/macvlan.c @@ -1470,8 +1470,10 @@ int macvlan_common_newlink(struct net *src_net, struct net_device *dev, /* the macvlan port may be freed by macvlan_uninit when fail to register. * so we destroy the macvlan port only when it's valid. */ - if (create && macvlan_port_get_rtnl(lowerdev)) + if (create && macvlan_port_get_rtnl(lowerdev)) { + macvlan_flush_sources(port, vlan); macvlan_port_destroy(port->dev); + } return err; } EXPORT_SYMBOL_GPL(macvlan_common_newlink);