diff options
author | Sven Eckelmann | 2013-02-11 17:10:22 +0800 |
---|---|---|
committer | Antonio Quartulli | 2013-03-27 10:27:31 +0100 |
commit | 37130293fd50918c5498bafafd18735a24229cb9 (patch) | |
tree | 04bd6194d9ffd990f54b55b81fde4ad133c53574 /net/batman-adv/hard-interface.c | |
parent | e6a0b495ffee1301c239da49818008e7de3c2ae1 (diff) |
batman-adv: Move soft-interface initialization to ndo_init
The initialization of an net_device object should be done in the
init/constructor function and not from the outside after the register_netdevice
was done to avoid race conditions.
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Acked-by: Antonio Quartulli <ordex@autistici.org>
Signed-off-by: Antonio Quartulli <ordex@autistici.org>
Diffstat (limited to 'net/batman-adv/hard-interface.c')
-rw-r--r-- | net/batman-adv/hard-interface.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/net/batman-adv/hard-interface.c b/net/batman-adv/hard-interface.c index 368219e026a9..da000e90f87f 100644 --- a/net/batman-adv/hard-interface.c +++ b/net/batman-adv/hard-interface.c @@ -563,6 +563,11 @@ static int batadv_hard_if_event(struct notifier_block *this, struct batadv_hard_iface *primary_if = NULL; struct batadv_priv *bat_priv; + if (batadv_softif_is_valid(net_dev) && event == NETDEV_REGISTER) { + batadv_sysfs_add_meshif(net_dev); + return NOTIFY_DONE; + } + hard_iface = batadv_hardif_get_by_netdev(net_dev); if (!hard_iface && event == NETDEV_REGISTER) hard_iface = batadv_hardif_add_interface(net_dev); |