phonet: exit_net cleanup check added
authorVasily Averin <vvs@virtuozzo.com>
Sun, 12 Nov 2017 19:32:47 +0000 (22:32 +0300)
committerDavid S. Miller <davem@davemloft.net>
Tue, 14 Nov 2017 06:45:53 +0000 (15:45 +0900)
Be sure that pndevs.list initialized in net_init hook was return
to initial state.

Signed-off-by: Vasily Averin <vvs@virtuozzo.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/phonet/pn_dev.c

index 2cb4c5dfad6f76310275b90a0da4cddc2eb92fe1..77787512fc32cbd0a0cb842a88a31c6711218b8c 100644 (file)
@@ -331,7 +331,10 @@ static int __net_init phonet_init_net(struct net *net)
 
 static void __net_exit phonet_exit_net(struct net *net)
 {
+       struct phonet_net *pnn = phonet_pernet(net);
+
        remove_proc_entry("phonet", net->proc_net);
+       WARN_ON_ONCE(!list_empty(&pnn->pndevs.list));
 }
 
 static struct pernet_operations phonet_net_ops = {