Thread (26 messages) 26 messages, 5 authors, 2009-10-31

Re: [PATCH 5/6] bond: Implement a basic set of rtnl link ops

From: Patrick McHardy <hidden>
Date: 2009-10-30 08:06:05

Eric W. Biederman wrote:
quoted hunk ↗ jump to hunk
@@ -5115,6 +5118,10 @@ static int __init bonding_init(void)
 
 	bond_create_proc_dir();
 
+	res = rtnl_link_register(&bond_link_ops);
+	if (res)
+		goto err;
The error handling looks wrong, at err: you call rtnl_link_unregister()
after rtnl_link_register() failed.
quoted hunk ↗ jump to hunk
+
 	for (i = 0; i < max_bonds; i++) {
 		res = bond_create(NULL);
 		if (res)
@@ -5128,14 +5135,12 @@ static int __init bonding_init(void)
 	register_netdevice_notifier(&bond_netdev_notifier);
 	register_inetaddr_notifier(&bond_inetaddr_notifier);
 	bond_register_ipv6_notifier();
-
-	goto out;
-err:
-	rtnl_lock();
-	bond_free_all();
-	rtnl_unlock();
 out:
 	return res;
+err:
+	rtnl_link_unregister(&bond_link_ops);
+	bond_destroy_proc_dir();
+	goto out;
 
 }
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help