From 06ba7ce223045369cb5459f95e6c27e708938cf4 Mon Sep 17 00:00:00 2001 From: Simon Wunderlich Date: Mon, 7 Nov 2011 13:57:48 +0100 Subject: [PATCH] batman-adv: use unregister_netdevice() when softif_create fails When entering softif_create(), the rtnl lock has already been acquired by store_mesh_iface(). (store_mesh_iface() -> hardif_enable_interface() -> softif_create) In case of an error, we should therefore call unregister_netdevice() instead of unregister_netdev(). unregister_netdev() tries to acquire the rtnl lock itself and deadlocks in this situation. unregister_netdevice() assumes that the rtnl lock is already been held. Signed-off-by: Simon Wunderlich Signed-off-by: Sven Eckelmann --- net/batman-adv/soft-interface.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c index 45297c843092..987c75a775f9 100644 --- a/net/batman-adv/soft-interface.c +++ b/net/batman-adv/soft-interface.c @@ -874,7 +874,7 @@ struct net_device *softif_create(const char *name) unreg_sysfs: sysfs_del_meshif(soft_iface); unreg_soft_iface: - unregister_netdev(soft_iface); + unregister_netdevice(soft_iface); return NULL; free_soft_iface: -- GitLab