Skip to content

Commit

Permalink
prov/tcp: Set pep in passive_ep only if we return success
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
shefty committed Nov 22, 2019
1 parent 592c4d3 commit db96285
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions prov/tcp/src/tcpx_ep.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit db96285

Please sign in to comment.