Skip to content

Commit

Permalink
inet_diag: use sock_gen_put()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Oct 17, 2013
1 parent d7a20c8 commit c1d607c
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions net/ipv4/inet_diag.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit c1d607c

Please sign in to comment.