Skip to content

Commit

Permalink
batman-adv: use unregister_netdevice() when softif_create fails
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Sven Eckelmann <[email protected]>
  • Loading branch information
Simon Wunderlich authored and ecsv committed Nov 20, 2011
1 parent 80b3f58 commit 06ba7ce
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/batman-adv/soft-interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 06ba7ce

Please sign in to comment.