Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 189527
b: refs/heads/master
c: 9e2e61f
h: refs/heads/master
i:
  189525: 4b9728c
  189523: 859e9b5
  189519: e9c7469
v: v3
  • Loading branch information
Amerigo Wang authored and David S. Miller committed Apr 2, 2010
1 parent bd54e2f commit aec1aaf
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 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: 6503d96168f891ffa3b70ae6c9698a1a722025a0
refs/heads/master: 9e2e61fbf8ad016d24e4af0afff13505f3dd2a2a
26 changes: 14 additions & 12 deletions trunk/drivers/net/bonding/bond_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -4450,6 +4450,14 @@ static const struct net_device_ops bond_netdev_ops = {
.ndo_vlan_rx_kill_vid = bond_vlan_rx_kill_vid,
};

static void bond_destructor(struct net_device *bond_dev)
{
struct bonding *bond = netdev_priv(bond_dev);
if (bond->wq)
destroy_workqueue(bond->wq);
free_netdev(bond_dev);
}

static void bond_setup(struct net_device *bond_dev)
{
struct bonding *bond = netdev_priv(bond_dev);
Expand All @@ -4470,7 +4478,7 @@ static void bond_setup(struct net_device *bond_dev)
bond_dev->ethtool_ops = &bond_ethtool_ops;
bond_set_mode_ops(bond, bond->params.mode);

bond_dev->destructor = free_netdev;
bond_dev->destructor = bond_destructor;

/* Initialize the device options */
bond_dev->tx_queue_len = 0;
Expand Down Expand Up @@ -4542,9 +4550,6 @@ static void bond_uninit(struct net_device *bond_dev)

bond_remove_proc_entry(bond);

if (bond->wq)
destroy_workqueue(bond->wq);

netif_addr_lock_bh(bond_dev);
bond_mc_list_destroy(bond);
netif_addr_unlock_bh(bond_dev);
Expand Down Expand Up @@ -4956,8 +4961,8 @@ int bond_create(struct net *net, const char *name)
bond_setup);
if (!bond_dev) {
pr_err("%s: eek! can't alloc netdev!\n", name);
res = -ENOMEM;
goto out;
rtnl_unlock();
return -ENOMEM;
}

dev_net_set(bond_dev, net);
Expand All @@ -4966,19 +4971,16 @@ int bond_create(struct net *net, const char *name)
if (!name) {
res = dev_alloc_name(bond_dev, "bond%d");
if (res < 0)
goto out_netdev;
goto out;
}

res = register_netdevice(bond_dev);
if (res < 0)
goto out_netdev;

out:
rtnl_unlock();
if (res < 0)
bond_destructor(bond_dev);
return res;
out_netdev:
free_netdev(bond_dev);
goto out;
}

static int __net_init bond_net_init(struct net *net)
Expand Down

0 comments on commit aec1aaf

Please sign in to comment.