]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
batman-adv: don't initialise batman_iv private members in hard-interface.c
authorAntonio Quartulli <antonio@open-mesh.com>
Tue, 2 Apr 2013 10:16:53 +0000 (12:16 +0200)
committerAntonio Quartulli <ordex@autistici.org>
Wed, 29 May 2013 00:44:54 +0000 (02:44 +0200)
hard-interface.c has to do not contain any routing algorithm
specific code.

Allocate the hard-interface with kzalloc() and remove any
useless and algorithm specific member initialisation

Signed-off-by: Antonio Quartulli <antonio@open-mesh.com>
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
net/batman-adv/hard-interface.c

index 4a76ed654c924132e558598a03b9e0edb17a971d..c478e6bcf89b8bd570a54a9a811b4309c7a2e5f0 100644 (file)
@@ -577,7 +577,7 @@ batadv_hardif_add_interface(struct net_device *net_dev)
 
        dev_hold(net_dev);
 
-       hard_iface = kmalloc(sizeof(*hard_iface), GFP_ATOMIC);
+       hard_iface = kzalloc(sizeof(*hard_iface), GFP_ATOMIC);
        if (!hard_iface)
                goto release_dev;
 
@@ -603,12 +603,6 @@ batadv_hardif_add_interface(struct net_device *net_dev)
        batadv_check_known_mac_addr(hard_iface->net_dev);
        list_add_tail_rcu(&hard_iface->list, &batadv_hardif_list);
 
-       /* This can't be called via a bat_priv callback because
-        * we have no bat_priv yet.
-        */
-       atomic_set(&hard_iface->bat_iv.ogm_seqno, 1);
-       hard_iface->bat_iv.ogm_buff = NULL;
-
        return hard_iface;
 
 free_if: