aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/inet_diag.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv4/inet_diag.c')
-rw-r--r--net/ipv4/inet_diag.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/net/ipv4/inet_diag.c b/net/ipv4/inet_diag.c
index c10036e7a463..564230dabcb8 100644
--- a/net/ipv4/inet_diag.c
+++ b/net/ipv4/inet_diag.c
@@ -53,11 +53,9 @@ static DEFINE_MUTEX(inet_diag_table_mutex);
53 53
54static const struct inet_diag_handler *inet_diag_lock_handler(int type) 54static const struct inet_diag_handler *inet_diag_lock_handler(int type)
55{ 55{
56#ifdef CONFIG_KMOD
57 if (!inet_diag_table[type]) 56 if (!inet_diag_table[type])
58 request_module("net-pf-%d-proto-%d-type-%d", PF_NETLINK, 57 request_module("net-pf-%d-proto-%d-type-%d", PF_NETLINK,
59 NETLINK_INET_DIAG, type); 58 NETLINK_INET_DIAG, type);
60#endif
61 59
62 mutex_lock(&inet_diag_table_mutex); 60 mutex_lock(&inet_diag_table_mutex);
63 if (!inet_diag_table[type]) 61 if (!inet_diag_table[type])
@@ -782,11 +780,15 @@ skip_listen_ht:
782 struct sock *sk; 780 struct sock *sk;
783 struct hlist_node *node; 781 struct hlist_node *node;
784 782
783 num = 0;
784
785 if (hlist_empty(&head->chain) && hlist_empty(&head->twchain))
786 continue;
787
785 if (i > s_i) 788 if (i > s_i)
786 s_num = 0; 789 s_num = 0;
787 790
788 read_lock_bh(lock); 791 read_lock_bh(lock);
789 num = 0;
790 sk_for_each(sk, node, &head->chain) { 792 sk_for_each(sk, node, &head->chain) {
791 struct inet_sock *inet = inet_sk(sk); 793 struct inet_sock *inet = inet_sk(sk);
792 794