batman-adv: Avoid double freeing of bat_counters
authorMartin Hundebøll <martin@hundeboll.net>
Wed, 17 Apr 2013 19:13:16 +0000 (21:13 +0200)
committerAntonio Quartulli <ordex@autistici.org>
Tue, 21 May 2013 19:34:36 +0000 (21:34 +0200)
commitf69ae770e74df420fbcf93aae81b30a5dcc73b7d
tree366080c1947e6650815e56c45f6ba53fe12a1cad
parent3ccfc1b1d2fa78f8ece83646027982916fcc794b
batman-adv: Avoid double freeing of bat_counters

On errors in batadv_mesh_init(), bat_counters will be freed in both
batadv_mesh_free() and batadv_softif_init_late(). This patch fixes this
by returning earlier from batadv_softif_init_late() in case of errors in
batadv_mesh_init() and by setting bat_counters to NULL after freeing.

Signed-off-by: Martin Hundebøll <martin@hundeboll.net>
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Signed-off-by: Antonio Quartulli <ordex@autistici.org>
net/batman-adv/main.c
net/batman-adv/soft-interface.c