Commit d02cea0f authored by David S. Miller's avatar David S. Miller

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: default avatarDavid S. Miller <davem@davemloft.net>
parents c573972c f69ae770
...@@ -181,6 +181,7 @@ void batadv_mesh_free(struct net_device *soft_iface) ...@@ -181,6 +181,7 @@ void batadv_mesh_free(struct net_device *soft_iface)
batadv_originator_free(bat_priv); batadv_originator_free(bat_priv);
free_percpu(bat_priv->bat_counters); free_percpu(bat_priv->bat_counters);
bat_priv->bat_counters = NULL;
atomic_set(&bat_priv->mesh_state, BATADV_MESH_INACTIVE); atomic_set(&bat_priv->mesh_state, BATADV_MESH_INACTIVE);
} }
......
...@@ -505,6 +505,7 @@ static int batadv_softif_init_late(struct net_device *dev) ...@@ -505,6 +505,7 @@ static int batadv_softif_init_late(struct net_device *dev)
batadv_debugfs_del_meshif(dev); batadv_debugfs_del_meshif(dev);
free_bat_counters: free_bat_counters:
free_percpu(bat_priv->bat_counters); free_percpu(bat_priv->bat_counters);
bat_priv->bat_counters = NULL;
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment