Skip to contentSkip to conversation

fib_notifier: exit_net cleanup check added

PATCH Superseded Vasily Averin 1 participant 1 message Nov 5, 2017

Subsystems (3)

v1 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH 7/21 fib_notifier: exit_net cleanup check added

Be sure that fib_notifier_ops list initilized in net_init hook was return to initial state.

---
 net/core/fib_notifier.c | 7 +++++++
 1 file changed, 7 insertions(+)
net/core/fib_notifier.c +7 -0
index 4fc202d..2de8df3 100644
@@ -161,8 +161,15 @@ static int __net_init fib_notifier_net_init(struct net *net)
 	return 0;
 }
 
+static void __net_exit fib_notifier_net_exit(struct net *net)
+{
+	WARN(!list_empty(&net->fib_notifier_ops),
+	     "net %p exit: fib_notifier_ops list is not empty\n", net);
+}
+
 static struct pernet_operations fib_notifier_net_ops = {
 	.init = fib_notifier_net_init,
+	.exit = fib_notifier_net_exit,
 };
 
 static int __init fib_notifier_init(void)
Signature · 1 line
2.7.4