git: eac97072d19b - stable/13 - sctp: another cleanup

From: Michael Tuexen <tuexen_at_FreeBSD.org>
Date: Thu, 31 Oct 2024 17:06:42 UTC
The branch stable/13 has been updated by tuexen:

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

commit eac97072d19b44d131025359e26e15c501d94f8c
Author:     Michael Tuexen <tuexen@FreeBSD.org>
AuthorDate: 2024-10-27 14:01:45 +0000
Commit:     Michael Tuexen <tuexen@FreeBSD.org>
CommitDate: 2024-10-31 17:06:20 +0000

    sctp: another cleanup
    
    No functional change intended.
    
    (cherry picked from commit d08713dcdb158b2f55a885e7cfbbe410272c55a2)
---
 sys/netinet/sctp_pcb.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c
index 2423aef5a89d..39b7d58c8892 100644
--- a/sys/netinet/sctp_pcb.c
+++ b/sys/netinet/sctp_pcb.c
@@ -543,7 +543,7 @@ sctp_add_addr_to_vrf(uint32_t vrf_id, void *ifn, uint32_t ifn_index,
 			} else {
 				/*
 				 * The last IFN gets the address, remove the
-				 * old one
+				 * old one.
 				 */
 				SCTPDBG(SCTP_DEBUG_PCB4,
 				    "Moving ifa %p from %s (0x%x) to %s (0x%x)\n",
@@ -691,13 +691,14 @@ sctp_del_addr_from_vrf(uint32_t vrf_id, struct sockaddr *addr,
     uint32_t ifn_index, const char *if_name)
 {
 	struct sctp_vrf *vrf;
-	struct sctp_ifa *sctp_ifap = NULL;
+	struct sctp_ifa *sctp_ifap;
 
 	SCTP_IPI_ADDR_WLOCK();
 	vrf = sctp_find_vrf(vrf_id);
 	if (vrf == NULL) {
 		SCTPDBG(SCTP_DEBUG_PCB4, "Can't find vrf_id 0x%x\n", vrf_id);
-		goto out_now;
+		SCTP_IPI_ADDR_WUNLOCK();
+		return;
 	}
 
 #ifdef SCTP_DEBUG
@@ -705,10 +706,10 @@ sctp_del_addr_from_vrf(uint32_t vrf_id, struct sockaddr *addr,
 	SCTPDBG_ADDR(SCTP_DEBUG_PCB4, addr);
 #endif
 	sctp_ifap = sctp_find_ifa_by_addr(addr, vrf->vrf_id, SCTP_ADDR_LOCKED);
-	if (sctp_ifap) {
+	if (sctp_ifap != NULL) {
 		/* Validate the delete */
 		if (sctp_ifap->ifn_p) {
-			int valid = 0;
+			bool valid = false;
 
 			/*-
 			 * The name has priority over the ifn_index
@@ -717,13 +718,13 @@ sctp_del_addr_from_vrf(uint32_t vrf_id, struct sockaddr *addr,
 			if (if_name) {
 				if (strncmp(if_name, sctp_ifap->ifn_p->ifn_name, SCTP_IFNAMSIZ) == 0) {
 					/* They match its a correct delete */
-					valid = 1;
+					valid = true;
 				}
 			}
 			if (!valid) {
 				/* last ditch check ifn_index */
 				if (ifn_index == sctp_ifap->ifn_p->ifn_index) {
-					valid = 1;
+					valid = true;
 				}
 			}
 			if (!valid) {
@@ -757,9 +758,8 @@ sctp_del_addr_from_vrf(uint32_t vrf_id, struct sockaddr *addr,
 	}
 #endif
 
-out_now:
 	SCTP_IPI_ADDR_WUNLOCK();
-	if (sctp_ifap) {
+	if (sctp_ifap != NULL) {
 		struct sctp_laddr *wi;
 
 		wi = SCTP_ZONE_GET(SCTP_BASE_INFO(ipi_zone_laddr), struct sctp_laddr);