Skip to content

Commit

Permalink
prov/rxm: fix rxm multi recv getopt segfault
Browse files Browse the repository at this point in the history
this prevents a segfault when the application calls fi_getopt
of FI_OPT_MIN_MULTI_RECV before the endpoint gets enabled.

Signed-off-by: Jerome Soumagne <[email protected]>
  • Loading branch information
soumagne committed Jan 25, 2025
1 parent d1fd795 commit 9e2caa7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions prov/rxm/src/rxm_ep.c
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,10 @@ static int rxm_ep_getopt(fid_t fid, int level, int optname, void *optval,

switch (optname) {
case FI_OPT_MIN_MULTI_RECV:
return rxm_ep->srx->ep_fid.ops->getopt(&rxm_ep->srx->ep_fid.fid,
level, optname, optval, optlen);
assert(sizeof(rxm_ep->min_multi_recv_size) == sizeof(size_t));
*(size_t *)optval = rxm_ep->min_multi_recv_size;
*optlen = sizeof(size_t);
break;
case FI_OPT_BUFFERED_MIN:
assert(sizeof(rxm_ep->buffered_min) == sizeof(size_t));
*(size_t *)optval = rxm_ep->buffered_min;
Expand Down

0 comments on commit 9e2caa7

Please sign in to comment.