Thread (83 messages) flat view 83 messages, 9 authors, 2017-11-14
STALE3198d

[PATCH v3 06/21] netdev: exit_net cleanup check added

From: Vasily Averin <hidden>
Date: 2017-11-06 13:24:08
Subsystem: networking [general], the rest · Maintainers: "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds

Be sure that dev_base_head list initialized in net_init hook was return
to initial state

Signed-off-by: Vasily Averin <redacted>
---
 net/core/dev.c | 4 ++++
 1 file changed, 4 insertions(+)
diff --git a/net/core/dev.c b/net/core/dev.c
index 588b473..34f88fc 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -8562,6 +8562,10 @@ static void __net_exit netdev_exit(struct net *net)
 {
 	kfree(net->dev_name_head);
 	kfree(net->dev_index_head);
+	if (net != &init_net)
+		WARN_ONCE(!list_empty(&net->dev_base_head),
+			  "net %x %s: dev_base_head is not empty\n",
+			  net->ns.inum, __func__);
 }
 
 static struct pernet_operations __net_initdata netdev_net_ops = {
-- 
2.7.4
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help