Browse Source

Merge tag 'batman-adv-fix-for-davem' of git://git.open-mesh.org/linux-merge

Included change:
- fix double free in case of failure during mesh initialisation

Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller 12 years ago
parent
commit
d02cea0f43
2 changed files with 2 additions and 0 deletions
  1. 1 0
      net/batman-adv/main.c
  2. 1 0
      net/batman-adv/soft-interface.c

+ 1 - 0
net/batman-adv/main.c

@@ -181,6 +181,7 @@ void batadv_mesh_free(struct net_device *soft_iface)
 	batadv_originator_free(bat_priv);
 
 	free_percpu(bat_priv->bat_counters);
+	bat_priv->bat_counters = NULL;
 
 	atomic_set(&bat_priv->mesh_state, BATADV_MESH_INACTIVE);
 }

+ 1 - 0
net/batman-adv/soft-interface.c

@@ -505,6 +505,7 @@ unreg_debugfs:
 	batadv_debugfs_del_meshif(dev);
 free_bat_counters:
 	free_percpu(bat_priv->bat_counters);
+	bat_priv->bat_counters = NULL;
 
 	return ret;
 }