aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bonding/bond_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/bonding/bond_main.c')
-rw-r--r--drivers/net/bonding/bond_main.c22
1 files changed, 4 insertions, 18 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index a58a60859da9..17c9580068b2 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -5089,14 +5089,6 @@ int bond_create(const char *name)
5089 int res; 5089 int res;
5090 5090
5091 rtnl_lock(); 5091 rtnl_lock();
5092 /* Check to see if the bond already exists. */
5093 /* FIXME: pass netns from caller */
5094 if (name && __dev_get_by_name(&init_net, name)) {
5095 pr_err(DRV_NAME ": cannot add bond %s; already exists\n",
5096 name);
5097 res = -EEXIST;
5098 goto out_rtnl;
5099 }
5100 5092
5101 bond_dev = alloc_netdev(sizeof(struct bonding), name ? name : "", 5093 bond_dev = alloc_netdev(sizeof(struct bonding), name ? name : "",
5102 bond_setup); 5094 bond_setup);
@@ -5104,7 +5096,7 @@ int bond_create(const char *name)
5104 pr_err(DRV_NAME ": %s: eek! can't alloc netdev!\n", 5096 pr_err(DRV_NAME ": %s: eek! can't alloc netdev!\n",
5105 name); 5097 name);
5106 res = -ENOMEM; 5098 res = -ENOMEM;
5107 goto out_rtnl; 5099 goto out;
5108 } 5100 }
5109 5101
5110 if (!name) { 5102 if (!name) {
@@ -5114,19 +5106,13 @@ int bond_create(const char *name)
5114 } 5106 }
5115 5107
5116 res = register_netdevice(bond_dev); 5108 res = register_netdevice(bond_dev);
5117 if (res < 0)
5118 goto out_bond;
5119 5109
5110out:
5120 rtnl_unlock(); 5111 rtnl_unlock();
5121 return 0; 5112 return res;
5122
5123out_bond:
5124 bond_deinit(bond_dev);
5125out_netdev: 5113out_netdev:
5126 free_netdev(bond_dev); 5114 free_netdev(bond_dev);
5127out_rtnl: 5115 goto out;
5128 rtnl_unlock();
5129 return res;
5130} 5116}
5131 5117
5132static int __init bonding_init(void) 5118static int __init bonding_init(void)