diff options
| author | John Baldwin <jhb@FreeBSD.org> | 2026-04-20 17:18:04 +0000 |
|---|---|---|
| committer | John Baldwin <jhb@FreeBSD.org> | 2026-04-20 17:18:04 +0000 |
| commit | 505f381cb96ee25bcf0df11cfaf15a601d969500 (patch) | |
| tree | bf27e09723d6db28607d177a8a68fb57e82d44d4 | |
| parent | 0d16792c6e983005581ed0176ed81e7302582196 (diff) | |
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
| -rw-r--r-- | sys/dev/cxgbe/nvmf/nvmf_che.c | 1 |
1 files changed, 1 insertions, 0 deletions
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); } |
