Staging: batman-adv: Call unregister_netdev on failures to get rtnl lock
authorSven Eckelmann <sven.eckelmann@gmx.de>
Sat, 22 May 2010 15:48:45 +0000 (17:48 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 4 Jun 2010 20:38:55 +0000 (13:38 -0700)
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
unregister_netdev.

Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/batman-adv/main.c

index 9d13979c2d8ee071d8f29442d03ccc05bc8b64a5..50a66b42d476e200113b4438e3910ee9ae7a4b0b 100644 (file)
@@ -127,7 +127,7 @@ int init_module(void)
        return 0;
 
 unreg_soft_device:
-       unregister_netdevice(soft_device);
+       unregister_netdev(soft_device);
 free_soft_device:
        free_netdev(soft_device);
        soft_device = NULL;