net: do not call sock_put() on TIMEWAIT sockets

[ Upstream commit 80ad1d61e7 ]

commit 3ab5aee7fe ("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: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Eric Dumazet 2013-10-01 21:04:11 -07:00 committed by Greg Kroah-Hartman
parent d1e668e717
commit 791673fbfa
2 changed files with 2 additions and 2 deletions

View file

@ -268,7 +268,7 @@ begintw:
}
if (unlikely(!INET_TW_MATCH(sk, net, hash, acookie,
saddr, daddr, ports, dif))) {
sock_put(sk);
inet_twsk_put(inet_twsk(sk));
goto begintw;
}
goto out;

View file

@ -110,7 +110,7 @@ begintw:
goto out;
}
if (!INET6_TW_MATCH(sk, net, hash, saddr, daddr, ports, dif)) {
sock_put(sk);
inet_twsk_put(inet_twsk(sk));
goto begintw;
}
goto out;