On Wed, Apr 17, 2013 at 12:28:50PM +0200, Martin Hundebøll wrote:
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().
Signed-off-by: Martin Hundebøll martin@hundeboll.net
soft-interface.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/soft-interface.c b/soft-interface.c index c2a9c20..4de4d0f 100644 --- a/soft-interface.c +++ b/soft-interface.c @@ -503,6 +503,9 @@ static int batadv_softif_init_late(struct net_device *dev)
unreg_debugfs: batadv_debugfs_del_meshif(dev);
- return ret;
Hi Martin, good catch! But using 1 goto to execute 1 operation is not very good. What about this:
ret = batadv_mesh_init(dev); if (ret < 0) batadv_debugfs_del_meshif(dev);
return ret;
and remove the unreg_debugfs label at all (and its content)
Cheers,