Commit 80ad1d61 authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller

net: do not call sock_put() on TIMEWAIT sockets

commit 3ab5aee7 ("net: Convert TCP & DCCP hash tables to use RCU /
hlist_nulls") incorrectly used sock_put() on TIMEWAIT sockets.

We should instead use inet_twsk_put()
Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 28ad7b06
...@@ -287,7 +287,7 @@ struct sock *__inet_lookup_established(struct net *net, ...@@ -287,7 +287,7 @@ struct sock *__inet_lookup_established(struct net *net,
if (unlikely(!INET_TW_MATCH(sk, net, acookie, if (unlikely(!INET_TW_MATCH(sk, net, acookie,
saddr, daddr, ports, saddr, daddr, ports,
dif))) { dif))) {
sock_put(sk); inet_twsk_put(inet_twsk(sk));
goto begintw; goto begintw;
} }
goto out; goto out;
......
...@@ -116,7 +116,7 @@ struct sock *__inet6_lookup_established(struct net *net, ...@@ -116,7 +116,7 @@ struct sock *__inet6_lookup_established(struct net *net,
} }
if (unlikely(!INET6_TW_MATCH(sk, net, saddr, daddr, if (unlikely(!INET6_TW_MATCH(sk, net, saddr, daddr,
ports, dif))) { ports, dif))) {
sock_put(sk); inet_twsk_put(inet_twsk(sk));
goto begintw; goto begintw;
} }
goto out; goto out;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment