From db96285360eeb716fc511a6188a6fba5d8c409e3 Mon Sep 17 00:00:00 2001 From: Sean Hefty Date: Fri, 22 Nov 2019 08:36:30 -0800 Subject: [PATCH] prov/tcp: Set pep in passive_ep only if we return success This fixes a segfault in rxm when tcpx_pep_sock_create() fails, and the passive endpoint is not created, but the user's passed in pep variable has been modified (and is no longer non-null). Signed-off-by: Sean Hefty --- prov/tcp/src/tcpx_ep.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/prov/tcp/src/tcpx_ep.c b/prov/tcp/src/tcpx_ep.c index 1ca75808c9f..deae492c3bc 100644 --- a/prov/tcp/src/tcpx_ep.c +++ b/prov/tcp/src/tcpx_ep.c @@ -792,13 +792,13 @@ int tcpx_passive_ep(struct fid_fabric *fabric, struct fi_info *info, _pep->cm_ctx.cm_data_sz = 0; _pep->sock = INVALID_SOCKET; - *pep = &_pep->util_pep.pep_fid; - if (info->src_addr) { ret = tcpx_pep_sock_create(_pep); if (ret) goto err3; } + + *pep = &_pep->util_pep.pep_fid; return FI_SUCCESS; err3: fi_freeinfo(_pep->info);