net: Remove CONFIG_KMOD from net/ (towards removing CONFIG_KMOD entirely)
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / net / ipv4 / inet_diag.c
index c10036e7a46349130d3a27c16c0a341795581d27..564230dabcb8a7ff172bed468a4257dd0a11616f 100644 (file)
@@ -53,11 +53,9 @@ static DEFINE_MUTEX(inet_diag_table_mutex);
 
 static const struct inet_diag_handler *inet_diag_lock_handler(int type)
 {
-#ifdef CONFIG_KMOD
        if (!inet_diag_table[type])
                request_module("net-pf-%d-proto-%d-type-%d", PF_NETLINK,
                               NETLINK_INET_DIAG, type);
-#endif
 
        mutex_lock(&inet_diag_table_mutex);
        if (!inet_diag_table[type])
@@ -782,11 +780,15 @@ skip_listen_ht:
                struct sock *sk;
                struct hlist_node *node;
 
+               num = 0;
+
+               if (hlist_empty(&head->chain) && hlist_empty(&head->twchain))
+                       continue;
+
                if (i > s_i)
                        s_num = 0;
 
                read_lock_bh(lock);
-               num = 0;
                sk_for_each(sk, node, &head->chain) {
                        struct inet_sock *inet = inet_sk(sk);