From 866e577f1d62837b2c8a0ca8651b1e154292cc58 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Fri, 30 Apr 2021 19:19:53 +0200 Subject: [PATCH] Kernel: Don't put closed/listener sockets into the closing_sockets list --- Kernel/Net/TCPSocket.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Kernel/Net/TCPSocket.cpp b/Kernel/Net/TCPSocket.cpp index f41cfa88123..393d4ac53f5 100644 --- a/Kernel/Net/TCPSocket.cpp +++ b/Kernel/Net/TCPSocket.cpp @@ -471,8 +471,10 @@ KResult TCPSocket::close() set_state(State::LastAck); } - Locker locker(closing_sockets().lock()); - closing_sockets().resource().set(tuple(), *this); + if (state() != State::Closed && state() != State::Listen) { + Locker locker(closing_sockets().lock()); + closing_sockets().resource().set(tuple(), *this); + } return result; }