Skip to content
This repository was archived by the owner on Dec 20, 2023. It is now read-only.

Commit 53d384a

Browse files
edumazetgregkh
authored andcommitted
net: do not call sock_put() on TIMEWAIT sockets
[ Upstream commit 80ad1d6 ] commit 3ab5aee ("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 <[email protected]> Signed-off-by: David S. Miller <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent d8ac0f1 commit 53d384a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

net/ipv4/inet_hashtables.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ struct sock *__inet_lookup_established(struct net *net,
287287
if (unlikely(!INET_TW_MATCH(sk, net, acookie,
288288
saddr, daddr, ports,
289289
dif))) {
290-
sock_put(sk);
290+
inet_twsk_put(inet_twsk(sk));
291291
goto begintw;
292292
}
293293
goto out;

net/ipv6/inet6_hashtables.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ struct sock *__inet6_lookup_established(struct net *net,
116116
}
117117
if (unlikely(!INET6_TW_MATCH(sk, net, saddr, daddr,
118118
ports, dif))) {
119-
sock_put(sk);
119+
inet_twsk_put(inet_twsk(sk));
120120
goto begintw;
121121
}
122122
goto out;

0 commit comments

Comments
 (0)