From aaaa01c0c858fd703194c6cbd515dd514574381f Mon Sep 17 00:00:00 2001 From: Michael Tuexen Date: Fri, 5 Apr 2024 17:30:31 +0200 Subject: [PATCH] tcp hpts: initialize variable Ensure that tv.tv_sec is zero in all code paths. Reported by: Coverity Scan CID: 1527724 Reviewed by: rscheff MFC after: 3 days Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D44584 --- sys/netinet/tcp_hpts.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netinet/tcp_hpts.c b/sys/netinet/tcp_hpts.c index 1e6578429acd..85341cab0750 100644 --- a/sys/netinet/tcp_hpts.c +++ b/sys/netinet/tcp_hpts.c @@ -1651,6 +1651,7 @@ tcp_hpts_thread(void *ctx) * enough activity in the system that we don't need to * run as often (if we were not directly woken). */ + tv.tv_sec = 0; if (hpts->p_direct_wake == 0) { counter_u64_add(hpts_back_tosleep, 1); if (hpts->p_on_queue_cnt >= conn_cnt_thresh) { @@ -1675,7 +1676,6 @@ tcp_hpts_thread(void *ctx) * Directly woken most likely to reset the * callout time. */ - tv.tv_sec = 0; tv.tv_usec = hpts->p_mysleep.tv_usec; } goto back_to_sleep;