git: 6b454da6bbaa - main - tcp: address a warning
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 03 Apr 2024 22:18:39 UTC
The branch main has been updated by tuexen:
URL: https://cgit.FreeBSD.org/src/commit/?id=6b454da6bbaa3327cf9b7185d198c96ffc1b88f4
commit 6b454da6bbaa3327cf9b7185d198c96ffc1b88f4
Author: Michael Tuexen <tuexen@FreeBSD.org>
AuthorDate: 2024-04-03 22:14:59 +0000
Commit: Michael Tuexen <tuexen@FreeBSD.org>
CommitDate: 2024-04-03 22:14:59 +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
MFC after: 1 week
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D44619
---
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 860d65249148..312740ccf599 100644
--- a/sys/netinet/tcp_subr.c
+++ b/sys/netinet/tcp_subr.c
@@ -1086,7 +1086,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));