diff options
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/bonding/bond_main.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index e41b3e57260c..50a40e433154 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c | |||
@@ -1425,13 +1425,13 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) | |||
1425 | res = netdev_set_master(slave_dev, bond_dev); | 1425 | res = netdev_set_master(slave_dev, bond_dev); |
1426 | if (res) { | 1426 | if (res) { |
1427 | dprintk("Error %d calling netdev_set_master\n", res); | 1427 | dprintk("Error %d calling netdev_set_master\n", res); |
1428 | goto err_close; | 1428 | goto err_restore_mac; |
1429 | } | 1429 | } |
1430 | /* open the slave since the application closed it */ | 1430 | /* open the slave since the application closed it */ |
1431 | res = dev_open(slave_dev); | 1431 | res = dev_open(slave_dev); |
1432 | if (res) { | 1432 | if (res) { |
1433 | dprintk("Openning slave %s failed\n", slave_dev->name); | 1433 | dprintk("Openning slave %s failed\n", slave_dev->name); |
1434 | goto err_restore_mac; | 1434 | goto err_unset_master; |
1435 | } | 1435 | } |
1436 | 1436 | ||
1437 | new_slave->dev = slave_dev; | 1437 | new_slave->dev = slave_dev; |
@@ -1444,7 +1444,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) | |||
1444 | */ | 1444 | */ |
1445 | res = bond_alb_init_slave(bond, new_slave); | 1445 | res = bond_alb_init_slave(bond, new_slave); |
1446 | if (res) { | 1446 | if (res) { |
1447 | goto err_unset_master; | 1447 | goto err_close; |
1448 | } | 1448 | } |
1449 | } | 1449 | } |
1450 | 1450 | ||
@@ -1619,7 +1619,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) | |||
1619 | 1619 | ||
1620 | res = bond_create_slave_symlinks(bond_dev, slave_dev); | 1620 | res = bond_create_slave_symlinks(bond_dev, slave_dev); |
1621 | if (res) | 1621 | if (res) |
1622 | goto err_unset_master; | 1622 | goto err_close; |
1623 | 1623 | ||
1624 | printk(KERN_INFO DRV_NAME | 1624 | printk(KERN_INFO DRV_NAME |
1625 | ": %s: enslaving %s as a%s interface with a%s link.\n", | 1625 | ": %s: enslaving %s as a%s interface with a%s link.\n", |
@@ -1631,12 +1631,12 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) | |||
1631 | return 0; | 1631 | return 0; |
1632 | 1632 | ||
1633 | /* Undo stages on error */ | 1633 | /* Undo stages on error */ |
1634 | err_unset_master: | ||
1635 | netdev_set_master(slave_dev, NULL); | ||
1636 | |||
1637 | err_close: | 1634 | err_close: |
1638 | dev_close(slave_dev); | 1635 | dev_close(slave_dev); |
1639 | 1636 | ||
1637 | err_unset_master: | ||
1638 | netdev_set_master(slave_dev, NULL); | ||
1639 | |||
1640 | err_restore_mac: | 1640 | err_restore_mac: |
1641 | if (!bond->params.fail_over_mac) { | 1641 | if (!bond->params.fail_over_mac) { |
1642 | memcpy(addr.sa_data, new_slave->perm_hwaddr, ETH_ALEN); | 1642 | memcpy(addr.sa_data, new_slave->perm_hwaddr, ETH_ALEN); |