audit: remove useless synchronize_net()
authorWANG Cong <xiyou.wangcong@gmail.com>
Tue, 29 Nov 2016 17:14:56 +0000 (09:14 -0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 1 Dec 2016 16:29:02 +0000 (11:29 -0500)
netlink kernel socket is protected by refcount, not RCU.
Its rcv path is neither protected by RCU. So the synchronize_net()
is just pointless.

Cc: Richard Guy Briggs <rgb@redhat.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
kernel/audit.c

index 92c463d2d1c73b45086df19c34e37b43a393f77f..67b9fbd871be8ec0d9e557f654fe7463a29f82b5 100644 (file)
@@ -1172,9 +1172,8 @@ static void __net_exit audit_net_exit(struct net *net)
                audit_sock = NULL;
        }
 
-       RCU_INIT_POINTER(aunet->nlsk, NULL);
-       synchronize_net();
        netlink_kernel_release(sock);
+       aunet->nlsk = NULL;
 }
 
 static struct pernet_operations audit_net_ops __net_initdata = {