Skip to content

Commit

Permalink
Staging: batman-adv: Call unregister_netdev on failures to get rtnl lock
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Sven Eckelmann authored and Greg Kroah-Hartman committed Jun 4, 2010
1 parent 5f411a9 commit 20c8a44
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/staging/batman-adv/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 20c8a44

Please sign in to comment.