[B.A.T.M.A.N.] [PATCH] batman-adv: Don't call free_netdev twice

Sven Eckelmann sven.eckelmann at gmx.de
Wed May 19 16:02:02 CEST 2010


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 freed
net_device.

Signed-off-by: Sven Eckelmann <sven.eckelmann at gmx.de>
---
 batman-adv-kernelland/main.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/batman-adv-kernelland/main.c b/batman-adv-kernelland/main.c
index 51856a7..c9132c0 100644
--- a/batman-adv-kernelland/main.c
+++ b/batman-adv-kernelland/main.c
@@ -130,6 +130,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;
-- 
1.7.1



More information about the B.A.T.M.A.N mailing list