Free_netdev is registered as destructor in interface_setup for every soft_device. This destructor is automatically called from unregister_netdev and we must not call it again for the free'd net_device.
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 * batman-adv: Call unregister_netdev on failures to get rtnl lock
main.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/main.c b/main.c index 6e6d925..6c6df6b 100644 --- a/main.c +++ b/main.c @@ -138,6 +138,9 @@ unreg_sysfs: sysfs_del_meshif(soft_device); unreg_soft_device: unregister_netdev(soft_device); + soft_device = NULL; + return -ENOMEM; + free_soft_device: free_netdev(soft_device); soft_device = NULL;