git: 743516d51fa7 - main - ktls: don't try to unlock pcb if tcp_drop() already did

From: Gleb Smirnoff <glebius_at_FreeBSD.org>
Date: Wed, 17 May 2023 17:26:03 UTC
The branch main has been updated by glebius:

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

commit 743516d51fa7c7f35b2156b1985f100ddb64abc2
Author:     Gleb Smirnoff <glebius@FreeBSD.org>
AuthorDate: 2023-05-17 17:25:28 +0000
Commit:     Gleb Smirnoff <glebius@FreeBSD.org>
CommitDate: 2023-05-17 17:25:28 +0000

    ktls: don't try to unlock pcb if tcp_drop() already did
    
    Reviewed by:    rrs, gallatin
---
 sys/kern/uipc_ktls.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/sys/kern/uipc_ktls.c b/sys/kern/uipc_ktls.c
index 1e892dde9022..df4fe4b77c04 100644
--- a/sys/kern/uipc_ktls.c
+++ b/sys/kern/uipc_ktls.c
@@ -1715,10 +1715,12 @@ ktls_reset_send_tag(void *context, int pending)
 			CURVNET_SET(inp->inp_vnet);
 			tp = tcp_drop(tp, ECONNABORTED);
 			CURVNET_RESTORE();
-			if (tp != NULL)
+			if (tp != NULL) {
 				counter_u64_add(ktls_ifnet_reset_dropped, 1);
-		}
-		INP_WUNLOCK(inp);
+				INP_WUNLOCK(inp);
+			}
+		} else
+			INP_WUNLOCK(inp);
 		NET_EPOCH_EXIT(et);
 
 		counter_u64_add(ktls_ifnet_reset_failed, 1);