summaryrefslogtreecommitdiffstats
path: root/net/batman-adv/hard-interface.c
diff options
context:
space:
mode:
authorSven Eckelmann <sven@narfation.org>2013-02-11 10:10:22 +0100
committerAntonio Quartulli <ordex@autistici.org>2013-03-27 10:27:31 +0100
commit37130293fd50918c5498bafafd18735a24229cb9 (patch)
tree04bd6194d9ffd990f54b55b81fde4ad133c53574 /net/batman-adv/hard-interface.c
parentbatman-adv: Fix endianness errors for network coding (diff)
downloadlinux-37130293fd50918c5498bafafd18735a24229cb9.tar.xz
linux-37130293fd50918c5498bafafd18735a24229cb9.zip
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.c5
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);