Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 17 Apr 2024 13:54:36 GMT
From:      Michael Tuexen <tuexen@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: f3e2beb306c6 - stable/14 - tcp: address a warning
Message-ID:  <202404171354.43HDsame037157@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/14 has been updated by tuexen:

URL: https://cgit.FreeBSD.org/src/commit/?id=f3e2beb306c6778ab5d3c5774ad28643d939fad4

commit f3e2beb306c6778ab5d3c5774ad28643d939fad4
Author:     Michael Tuexen <tuexen@FreeBSD.org>
AuthorDate: 2024-04-03 22:14:59 +0000
Commit:     Michael Tuexen <tuexen@FreeBSD.org>
CommitDate: 2024-04-17 13:54:13 +0000

    tcp: address a warning
    
    t_state is an unsigned variable, so no need for testing that it is
    non-negative.
    
    Reported by:            Coverity Scan
    CID:                    1390885
    Reviewed by:            glebius
    Sponsored by:           Netflix, Inc.
    Differential Revision:  https://reviews.freebsd.org/D44619
    
    (cherry picked from commit 6b454da6bbaa3327cf9b7185d198c96ffc1b88f4)
---
 sys/netinet/tcp_subr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c
index c11bfce889e6..0ba35ea13130 100644
--- a/sys/netinet/tcp_subr.c
+++ b/sys/netinet/tcp_subr.c
@@ -1077,7 +1077,7 @@ tcp_default_fb_init(struct tcpcb *tp, void **ptr)
 	/* We don't use the pointer */
 	*ptr = NULL;
 
-	KASSERT(tp->t_state >= 0 && tp->t_state < TCPS_TIME_WAIT,
+	KASSERT(tp->t_state < TCPS_TIME_WAIT,
 	    ("%s: connection %p in unexpected state %d", __func__, tp,
 	    tp->t_state));
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202404171354.43HDsame037157>