All of lore.kernel.org
 help / color / mirror / Atom feed
* [B.A.T.M.A.N.] [PATCH net] net: batman-adv: Fix possible memleaks when fail to register_netdevice
@ 2017-04-25 12:03 ` gfree.wind
  0 siblings, 0 replies; 17+ messages in thread
From: gfree.wind @ 2017-04-25 12:03 UTC (permalink / raw)
  To: mareklindner, sw, a, davem, b.a.t.m.a.n, netdev; +Cc: Gao Feng

From: Gao Feng <fgao@ikuai8.com>

Because the func batadv_softif_init_late allocate some resources and
it would be invoked in register_netdevice. So we need to invoke the
func batadv_softif_free instead of free_netdev to cleanup when fail
to register_netdevice.

Signed-off-by: Gao Feng <fgao@ikuai8.com>
---
 net/batman-adv/soft-interface.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c
index d042c99..90bf990 100644
--- a/net/batman-adv/soft-interface.c
+++ b/net/batman-adv/soft-interface.c
@@ -1011,7 +1011,7 @@ struct net_device *batadv_softif_create(struct net *net, const char *name)
 	if (ret < 0) {
 		pr_err("Unable to register the batman interface '%s': %i\n",
 		       name, ret);
-		free_netdev(soft_iface);
+		batadv_softif_free(soft_iface);
 		return NULL;
 	}
 
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2017-06-09  7:26 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-25 12:03 [B.A.T.M.A.N.] [PATCH net] net: batman-adv: Fix possible memleaks when fail to register_netdevice gfree.wind
2017-04-25 12:03 ` gfree.wind
2017-04-25 13:53 ` [B.A.T.M.A.N.] " Sven Eckelmann
2017-04-25 13:53   ` Sven Eckelmann
2017-04-26  0:41   ` [B.A.T.M.A.N.] " Gao Feng
2017-04-26  0:41     ` Gao Feng
2017-04-26  5:57     ` [B.A.T.M.A.N.] " Sven Eckelmann
2017-04-26  5:57       ` Sven Eckelmann
2017-04-26  6:44       ` [B.A.T.M.A.N.] " Gao Feng
2017-04-26  6:44         ` Gao Feng
2017-04-26  7:16         ` [B.A.T.M.A.N.] " Sven Eckelmann
2017-04-26  7:16           ` Sven Eckelmann
2017-04-26  7:28           ` [B.A.T.M.A.N.] " Gao Feng
2017-04-26  7:28             ` Gao Feng
2017-06-09  7:23 ` [B.A.T.M.A.N.] " Sven Eckelmann
2017-06-09  7:26   ` 高峰
2017-06-09  7:26     ` 高峰

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.