diff options
author | Florian Westphal <fw@strlen.de> | 2009-05-08 07:49:11 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-05-09 16:19:47 -0400 |
commit | 9d34d1a20e8171be819a6c8c4de4eea6104d174e (patch) | |
tree | 871994a5d9058307d97d475e8e5d627bc2b6a1f1 /drivers/net/bonding | |
parent | be8be9eccbf2d908a7e56b3f7a71105cd88da06b (diff) |
bonding: fix panic if initialization fails
If module initialisation failed (e.g. because the bonding sysfs entry
cannot be created), kernel panics:
IP: [<ffffffff8024910a>] destroy_workqueue+0x2d/0x146
Call Trace:
[<ffffffff808268c4>] bond_destructor+0x28/0x78
[<ffffffff80b64471>] netdev_run_todo+0x231/0x25a
[<ffffffff80b6dbcd>] rtnl_unlock+0x9/0xb
[<ffffffff81567907>] bonding_init+0x83e/0x84a
Remove the calls to bond_work_cancel_all() and destroy_workqueue();
both are also called/scheduled via bond_free_all().
bond_destroy_sysfs is unecessary because the sysfs entry has
not been created in the error case.
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>
Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bonding')
-rw-r--r-- | drivers/net/bonding/bond_main.c | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 2188a96fc090..74824028f85c 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c | |||
@@ -5181,7 +5181,6 @@ static int __init bonding_init(void) | |||
5181 | { | 5181 | { |
5182 | int i; | 5182 | int i; |
5183 | int res; | 5183 | int res; |
5184 | struct bonding *bond; | ||
5185 | 5184 | ||
5186 | printk(KERN_INFO "%s", version); | 5185 | printk(KERN_INFO "%s", version); |
5187 | 5186 | ||
@@ -5212,13 +5211,6 @@ static int __init bonding_init(void) | |||
5212 | 5211 | ||
5213 | goto out; | 5212 | goto out; |
5214 | err: | 5213 | err: |
5215 | list_for_each_entry(bond, &bond_dev_list, bond_list) { | ||
5216 | bond_work_cancel_all(bond); | ||
5217 | destroy_workqueue(bond->wq); | ||
5218 | } | ||
5219 | |||
5220 | bond_destroy_sysfs(); | ||
5221 | |||
5222 | rtnl_lock(); | 5214 | rtnl_lock(); |
5223 | bond_free_all(); | 5215 | bond_free_all(); |
5224 | rtnl_unlock(); | 5216 | rtnl_unlock(); |