git: a27063a57491 - stable/13 - sctp: cleanup, on functional change intended.

From: Michael Tuexen <tuexen_at_FreeBSD.org>
Date: Tue, 22 Feb 2022 23:55:55 UTC
The branch stable/13 has been updated by tuexen:

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

commit a27063a57491fd1e49d5a61f960dd1edef1a25ee
Author:     Michael Tuexen <tuexen@FreeBSD.org>
AuthorDate: 2021-12-27 17:28:44 +0000
Commit:     Michael Tuexen <tuexen@FreeBSD.org>
CommitDate: 2022-02-22 23:54:24 +0000

    sctp: cleanup, on functional change intended.
    
    (cherry picked from commit 34ae6a1a442881681a9c63e93a189b9191db50ed)
---
 sys/netinet/sctputil.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/sys/netinet/sctputil.c b/sys/netinet/sctputil.c
index 8322603438c3..6c58ad47f274 100644
--- a/sys/netinet/sctputil.c
+++ b/sys/netinet/sctputil.c
@@ -2895,13 +2895,12 @@ sctp_timer_stop(int t_type, struct sctp_inpcb *inp, struct sctp_tcb *stcb,
 uint32_t
 sctp_calculate_len(struct mbuf *m)
 {
-	uint32_t tlen = 0;
 	struct mbuf *at;
+	uint32_t tlen;
 
-	at = m;
-	while (at) {
+	tlen = 0;
+	for (at = m; at != NULL; at = SCTP_BUF_NEXT(at)) {
 		tlen += SCTP_BUF_LEN(at);
-		at = SCTP_BUF_NEXT(at);
 	}
 	return (tlen);
 }