inet_diag: use sock_gen_put()
authorEric Dumazet <edumazet@google.com>
Fri, 11 Oct 2013 15:54:49 +0000 (08:54 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 17 Oct 2013 19:02:02 +0000 (15:02 -0400)
TCP listener refactoring, part 6 :

Use sock_gen_put() from inet_diag_dump_one_icsk() for future
SYN_RECV support.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/inet_diag.c

index 41e1c3ea8b517778666fac9bf89cf903abf6f833..56a964a553d2c739a03b880acd7158a4c9714b66 100644 (file)
@@ -336,12 +336,9 @@ int inet_diag_dump_one_icsk(struct inet_hashinfo *hashinfo, struct sk_buff *in_s
                err = 0;
 
 out:
-       if (sk) {
-               if (sk->sk_state == TCP_TIME_WAIT)
-                       inet_twsk_put((struct inet_timewait_sock *)sk);
-               else
-                       sock_put(sk);
-       }
+       if (sk)
+               sock_gen_put(sk);
+
 out_nosk:
        return err;
 }