From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefano Brivio To: passt-dev@passt.top Subject: [PATCH 12/16] tcp_splice: Logically dead code, CWE-561 Date: Tue, 05 Apr 2022 19:05:10 +0200 Message-ID: <20220405170514.2963773-13-sbrivio@redhat.com> In-Reply-To: <20220405170514.2963773-1-sbrivio@redhat.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1106040725504548580==" --===============1106040725504548580== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Reported by Coverity. Signed-off-by: Stefano Brivio --- tcp_splice.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/tcp_splice.c b/tcp_splice.c index 84df8ed..7c19d99 100644 --- a/tcp_splice.c +++ b/tcp_splice.c @@ -139,9 +139,6 @@ static void tcp_splice_conn_epoll_events(uint16_t events, { *a = *b = 0; - if (events & CLOSED) - return; - if (events & ESTABLISHED) { if (!(events & B_FIN_SENT)) *a = EPOLLIN | EPOLLRDHUP; @@ -649,8 +646,8 @@ swap: } while (1) { - int retry_write = 0, more = 0; ssize_t readlen, to_write = 0, written; + int more = 0; retry: readlen = splice(from, NULL, pipes[1], NULL, c->tcp.pipe_size, @@ -715,9 +712,6 @@ eintr: if (never_read) break; - if (retry_write--) - goto retry; - if (to == conn->a) conn_event(c, conn, A_OUT_WAIT); else -- 2.35.1 --===============1106040725504548580==--