Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 20 Apr 2026 17:20:23 +0000
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 505f381cb96e - main - nvmf_che: Don't leak a socket if an error occurs finalizing the socket
Message-ID:  <69e66057.3f615.57d6933e@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch main has been updated by jhb:

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

commit 505f381cb96ee25bcf0df11cfaf15a601d969500
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2026-04-20 17:18:04 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2026-04-20 17:18:04 +0000

    nvmf_che: Don't leak a socket if an error occurs finalizing the socket
    
    If soreserve() or sosetopt() (to set TCP_NODELAY) fails after claiming
    the socket from the file descriptor, explicitly close the socket
    before returning failure.
    
    Sponsored by:   Chelsio Communications
    Differential Revision:  https://reviews.freebsd.org/D55493
---
 sys/dev/cxgbe/nvmf/nvmf_che.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sys/dev/cxgbe/nvmf/nvmf_che.c b/sys/dev/cxgbe/nvmf/nvmf_che.c
index afdfc2f1b758..be54e7bebfea 100644
--- a/sys/dev/cxgbe/nvmf/nvmf_che.c
+++ b/sys/dev/cxgbe/nvmf/nvmf_che.c
@@ -2605,6 +2605,7 @@ che_allocate_qpair(bool controller, const nvlist_t *nvl)
 		free(qp->fl_cids, M_NVMF_CHE);
 		free(qp->open_fl_ttags, M_NVMF_CHE);
 		free(qp, M_NVMF_CHE);
+		soclose(so);
 		return (NULL);
 	}
 


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?69e66057.3f615.57d6933e>