git: 15e2528c6b4c - stable/13 - cxgbei: Don't leak resources for an aborted target transfer.

From: John Baldwin <jhb_at_FreeBSD.org>
Date: Fri, 29 Oct 2021 23:58:09 UTC
The branch stable/13 has been updated by jhb:

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

commit 15e2528c6b4ca83a3eedceb6c0306d7d5992075c
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2021-05-14 19:17:26 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2021-10-29 22:57:37 +0000

    cxgbei: Don't leak resources for an aborted target transfer.
    
    Sponsored by:   Chelsio Communications
    Differential Revision:  https://reviews.freebsd.org/D29911
    
    (cherry picked from commit 4add8e4c89915dc0018a8480c63b6d6031d31295)
---
 sys/dev/cxgbe/cxgbei/icl_cxgbei.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sys/dev/cxgbe/cxgbei/icl_cxgbei.c b/sys/dev/cxgbe/cxgbei/icl_cxgbei.c
index f661d0a9d7d7..e3dc05645732 100644
--- a/sys/dev/cxgbe/cxgbei/icl_cxgbei.c
+++ b/sys/dev/cxgbe/cxgbei/icl_cxgbei.c
@@ -1153,7 +1153,8 @@ icl_cxgbei_conn_transfer_done(struct icl_conn *ic, void *arg)
 {
 	struct ctl_scsiio *ctsio = arg;
 
-	if (ctsio != NULL && ctsio->kern_data_len == ctsio->ext_data_filled) {
+	if (ctsio != NULL && (ctsio->kern_data_len == ctsio->ext_data_filled ||
+	    ic->ic_disconnecting)) {
 		struct ppod_reservation *prsv;
 
 		prsv = io_to_ppod_reservation(ctsio);