diff options
author | Gao Feng <fgao@ikuai8.com> | 2016-12-08 11:16:58 +0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-12-08 14:30:07 -0500 |
commit | 1a31cc86ef3ce9d873a713f422c34b47a188caec (patch) | |
tree | c6f57407f75fe9f8d27dc8428c440690e1f44ea1 /drivers | |
parent | 93a97c50cbf1c007caf12db5cc23e0d5b9c8473c (diff) | |
download | linux-1a31cc86ef3ce9d873a713f422c34b47a188caec.tar.bz2 |
driver: ipvlan: Unlink the upper dev when ipvlan_link_new failed
When netdev_upper_dev_unlink failed in ipvlan_link_new, need to
unlink the ipvlan dev with upper dev.
Signed-off-by: Gao Feng <fgao@ikuai8.com>
Acked-by: Mahesh Bandewar <maheshb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ipvlan/ipvlan_main.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/ipvlan/ipvlan_main.c b/drivers/net/ipvlan/ipvlan_main.c index 0fef17874d50..dfbc4ef6d507 100644 --- a/drivers/net/ipvlan/ipvlan_main.c +++ b/drivers/net/ipvlan/ipvlan_main.c @@ -546,13 +546,15 @@ static int ipvlan_link_new(struct net *src_net, struct net_device *dev, } err = ipvlan_set_port_mode(port, mode); if (err) { - goto unregister_netdev; + goto unlink_netdev; } list_add_tail_rcu(&ipvlan->pnode, &port->ipvlans); netif_stacked_transfer_operstate(phy_dev, dev); return 0; +unlink_netdev: + netdev_upper_dev_unlink(phy_dev, dev); unregister_netdev: unregister_netdevice(dev); destroy_ipvlan_port: |