[PATCH 14/27] Staging: batman-adv: Call unregister_netdev on failures to get rtnl lock

Greg Kroah-Hartman gregkh at suse.de
Fri Jun 4 20:45:31 UTC 2010

From: Sven Eckelmann <sven.eckelmann at gmx.de>

We must call unregister_netdev when we couldn't initialise the
batman-adv module and the soft_device was registered. There are two
version of the function which we can use:
 * unregister_netdevice - removes device
 * unregister_netdev - takes rtnl semaphore and remove device

We don't hold the semaphore in an error situation. So we must use

Signed-off-by: Sven Eckelmann <sven.eckelmann at gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh at suse.de>
 drivers/staging/batman-adv/main.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/batman-adv/main.c b/drivers/staging/batman-adv/main.c
index 9d13979..50a66b4 100644
--- a/drivers/staging/batman-adv/main.c
+++ b/drivers/staging/batman-adv/main.c
@@ -127,7 +127,7 @@ int init_module(void)
 	return 0;
-	unregister_netdevice(soft_device);
+	unregister_netdev(soft_device);
 	soft_device = NULL;

More information about the devel mailing list