* [B.A.T.M.A.N.] [PATCH] batman-adv: use unregister_netdevice() when softif_create fails
@ 2011-11-07 12:57 Simon Wunderlich
2011-11-08 18:38 ` Marek Lindner
0 siblings, 1 reply; 2+ messages in thread
From: Simon Wunderlich @ 2011-11-07 12:57 UTC (permalink / raw)
To: b.a.t.m.a.n; +Cc: Simon Wunderlich
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 <siwu@hrz.tu-chemnitz.de>
---
soft-interface.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/soft-interface.c b/soft-interface.c
index 45297c8..987c75a 100644
--- a/soft-interface.c
+++ b/soft-interface.c
@@ -874,7 +874,7 @@ unreg_debugfs:
unreg_sysfs:
sysfs_del_meshif(soft_iface);
unreg_soft_iface:
- unregister_netdev(soft_iface);
+ unregister_netdevice(soft_iface);
return NULL;
free_soft_iface:
--
1.7.7.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [B.A.T.M.A.N.] [PATCH] batman-adv: use unregister_netdevice() when softif_create fails
2011-11-07 12:57 [B.A.T.M.A.N.] [PATCH] batman-adv: use unregister_netdevice() when softif_create fails Simon Wunderlich
@ 2011-11-08 18:38 ` Marek Lindner
0 siblings, 0 replies; 2+ messages in thread
From: Marek Lindner @ 2011-11-08 18:38 UTC (permalink / raw)
To: The list for a Better Approach To Mobile Ad-hoc Networking
On Monday, November 07, 2011 20:57:48 Simon Wunderlich wrote:
> 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.
Applied in revision c103efd.
Thanks,
Marek
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-11-08 18:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-07 12:57 [B.A.T.M.A.N.] [PATCH] batman-adv: use unregister_netdevice() when softif_create fails Simon Wunderlich
2011-11-08 18:38 ` Marek Lindner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox