Hello David,
this is another small patch for net/linux-3.10. It is preventing a double free of the bat_counters in case of mesh initialisation failure.
Sorry for sending such small pull requests (I guess this is not that bad since they target net :-)), but these are small glitches we are finding while testing new features.
Please pull or let me know if there is any problem.
Thanks a lot, Antonio
The following changes since commit 3ccfc1b1d2fa78f8ece83646027982916fcc794b:
Merge branch 'for-davem' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless (2013-05-20 14:05:22 -0700)
are available in the git repository at:
git://git.open-mesh.org/linux-merge.git tags/batman-adv-fix-for-davem
for you to fetch changes up to f69ae770e74df420fbcf93aae81b30a5dcc73b7d:
batman-adv: Avoid double freeing of bat_counters (2013-05-21 21:34:36 +0200)
---------------------------------------------------------------- Included change: - fix double free in case of failure during mesh initialisation
---------------------------------------------------------------- Martin Hundebøll (1): batman-adv: Avoid double freeing of bat_counters
net/batman-adv/main.c | 1 + net/batman-adv/soft-interface.c | 1 + 2 files changed, 2 insertions(+)
From: Martin Hundebøll martin@hundeboll.net
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 | 1 + net/batman-adv/soft-interface.c | 1 + 2 files changed, 2 insertions(+)
diff --git a/net/batman-adv/main.c b/net/batman-adv/main.c index 1240f07..51aafd6 100644 --- a/net/batman-adv/main.c +++ b/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); } diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c index 6f20d33..819dfb0 100644 --- a/net/batman-adv/soft-interface.c +++ b/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; }
On Tue, May 21, 2013 at 09:53:54PM +0200, Antonio Quartulli wrote:
Hello David,
Sorry but git-send-email fooled me. Subject was supposed to be:
pull request for net: batman-adv 2013-05-21
Regards,
this is another small patch for net/linux-3.10. It is preventing a double free of the bat_counters in case of mesh initialisation failure.
Sorry for sending such small pull requests (I guess this is not that bad since they target net :-)), but these are small glitches we are finding while testing new features.
Please pull or let me know if there is any problem.
Thanks a lot, Antonio
From: Antonio Quartulli ordex@autistici.org Date: Tue, 21 May 2013 21:56:26 +0200
On Tue, May 21, 2013 at 09:53:54PM +0200, Antonio Quartulli wrote:
Hello David,
Sorry but git-send-email fooled me. Subject was supposed to be:
pull request for net: batman-adv 2013-05-21
Pulled, thanks Antonio.
b.a.t.m.a.n@lists.open-mesh.org