packet: exit_net cleanup check added
authorVasily Averin <vvs@virtuozzo.com>
Sun, 12 Nov 2017 19:27:49 +0000 (22:27 +0300)
committerDavid S. Miller <davem@davemloft.net>
Tue, 14 Nov 2017 06:45:52 +0000 (15:45 +0900)
Be sure that packet.sklist 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/packet/af_packet.c

index 9603f6ff17a44c68b74c2a0430536c777c6e3337..737092ca9b4eed464b6c0907d85b679ae4da6046 100644 (file)
@@ -4560,6 +4560,7 @@ static int __net_init packet_net_init(struct net *net)
 static void __net_exit packet_net_exit(struct net *net)
 {
        remove_proc_entry("packet", net->proc_net);
+       WARN_ON_ONCE(!hlist_empty(&net->packet.sklist));
 }
 
 static struct pernet_operations packet_net_ops = {