Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 46540
b: refs/heads/master
c: e4b91c4
h: refs/heads/master
v: v3
  • Loading branch information
Jay Vosburgh authored and Jeff Garzik committed Feb 5, 2007
1 parent 7042c11 commit f6a4ea1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bc63eb9c7ec0eb7b091db2d82d46d1e68ff9e231
refs/heads/master: e4b91c484611da385e34ff0f8bb2744ae2c735b7
14 changes: 10 additions & 4 deletions trunk/drivers/net/bonding/bond_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -4704,6 +4704,7 @@ static int bond_check_params(struct bond_params *params)
static struct lock_class_key bonding_netdev_xmit_lock_key;

/* Create a new bond based on the specified name and bonding parameters.
* If name is NULL, obtain a suitable "bond%d" name for us.
* Caller must NOT hold rtnl_lock; we need to release it here before we
* set up our sysfs entries.
*/
Expand All @@ -4713,7 +4714,8 @@ int bond_create(char *name, struct bond_params *params, struct bonding **newbond
int res;

rtnl_lock();
bond_dev = alloc_netdev(sizeof(struct bonding), name, ether_setup);
bond_dev = alloc_netdev(sizeof(struct bonding), name ? name : "",
ether_setup);
if (!bond_dev) {
printk(KERN_ERR DRV_NAME
": %s: eek! can't alloc netdev!\n",
Expand All @@ -4722,6 +4724,12 @@ int bond_create(char *name, struct bond_params *params, struct bonding **newbond
goto out_rtnl;
}

if (!name) {
res = dev_alloc_name(bond_dev, "bond%d");
if (res < 0)
goto out_netdev;
}

/* bond_init() must be called after dev_alloc_name() (for the
* /proc files), but before register_netdevice(), because we
* need to set function pointers.
Expand Down Expand Up @@ -4763,7 +4771,6 @@ static int __init bonding_init(void)
{
int i;
int res;
char new_bond_name[8]; /* Enough room for 999 bonds at init. */

printk(KERN_INFO "%s", version);

Expand All @@ -4776,8 +4783,7 @@ static int __init bonding_init(void)
bond_create_proc_dir();
#endif
for (i = 0; i < max_bonds; i++) {
sprintf(new_bond_name, "bond%d",i);
res = bond_create(new_bond_name,&bonding_defaults, NULL);
res = bond_create(NULL, &bonding_defaults, NULL);
if (res)
goto err;
}
Expand Down

0 comments on commit f6a4ea1

Please sign in to comment.