git: 4c89d59e0cda - main - TCP RACK: don't log an uninitialized value

From: Michael Tuexen <tuexen_at_FreeBSD.org>
Date: Wed, 08 Jan 2025 22:18:40 UTC
The branch main has been updated by tuexen:

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

commit 4c89d59e0cdac4d83fb5841aefae9214545b2273
Author:     Michael Tuexen <tuexen@FreeBSD.org>
AuthorDate: 2025-01-08 22:15:54 +0000
Commit:     Michael Tuexen <tuexen@FreeBSD.org>
CommitDate: 2025-01-08 22:15:54 +0000

    TCP RACK: don't log an uninitialized value
    
    reduce is uninitialized, if the code path for logging is reached via
    goto old_method;.
    
    Reviewed by:            rrs, Peter Lei
    CID:                    1557359
    MFC after:              1 week
    Sponsored by:           Netflix, Inc.
    Differential Revision:  https://reviews.freebsd.org/D48346
---
 sys/netinet/tcp_stacks/rack.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c
index f590edd71d9d..902845ad34f6 100644
--- a/sys/netinet/tcp_stacks/rack.c
+++ b/sys/netinet/tcp_stacks/rack.c
@@ -17474,7 +17474,7 @@ rack_get_pacing_delay(struct tcp_rack *rack, struct tcpcb *tp, uint32_t len, str
 		 * the peer to have a gap in data sending.
 		 */
 		uint64_t cwnd, tr_perms = 0;
-		int32_t reduce = 0;
+		int32_t reduce;
 
 	old_method:
 		/*
@@ -17511,7 +17511,8 @@ rack_get_pacing_delay(struct tcp_rack *rack, struct tcpcb *tp, uint32_t len, str
 				slot -= reduce;
 			} else
 				slot = 0;
-		}
+		} else
+			reduce = 0;
 		slot *= HPTS_USEC_IN_MSEC;
 		if (rack->rc_pace_to_cwnd) {
 			uint64_t rate_wanted = 0;