obj-$(CONFIG_PROC_FS) += net-procfs.o
--- a/net/core/sock.c
+++ b/net/core/sock.c
-@@ -1457,9 +1457,11 @@ void sk_destruct(struct sock *sk)
+@@ -1458,9 +1458,11 @@ void sk_destruct(struct sock *sk)
static void __sk_free(struct sock *sk)
{
+#ifdef CONFIG_SOCK_DIAG
- if (unlikely(sock_diag_has_destroy_listeners(sk) && sk->sk_net_refcnt))
+ if (unlikely(sk->sk_net_refcnt && sock_diag_has_destroy_listeners(sk)))
sock_diag_broadcast_destroy(sk);
else
+#endif