[maint] batman-adv: Call unregister_netdev on failures to get rtnl lock
Commit Message
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 a error case. So we must use
unregister_netdev.
Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de>
---
This patch is created for maint and should be applied using `git am`.
Following patches should be applied before:
* batman-adv: Move device for icmp injection to debugfs
* batman-adv: Move tables from sysfs to debugfs
main.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
@@ -137,7 +137,7 @@ int init_module(void)
unreg_sysfs:
sysfs_del_meshif(soft_device);
unreg_soft_device:
- unregister_netdevice(soft_device);
+ unregister_netdev(soft_device);
free_soft_device:
free_netdev(soft_device);
soft_device = NULL;