Skip to content

Commit

Permalink
prov/verbs: Fix coverity issue about overflowed return value
Browse files Browse the repository at this point in the history
The function `vrb_eq_xrc_recip_conn_event` was defined as size_t but
can return a nagative value on error which would overflow when casted
to int. Change the type to ssize_t.

Also change the return type of `vrb_eq_xrc_connected_event` to ssize_t
to be consistent with its caller and the function it calls.

Signed-off-by: Jianxin Xiong <[email protected]>
  • Loading branch information
j-xiong committed Nov 13, 2024
1 parent f61cb8a commit 75fe16c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions prov/verbs/src/verbs_eq.c
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,7 @@ vrb_eq_xrc_conn_event(struct vrb_xrc_ep *ep,
return -FI_EAGAIN;
}

static size_t
static ssize_t
vrb_eq_xrc_recip_conn_event(struct vrb_eq *eq,
struct vrb_xrc_ep *ep,
struct rdma_cm_event *cma_event,
Expand Down Expand Up @@ -787,15 +787,15 @@ vrb_eq_xrc_cm_err_event(struct vrb_eq *eq,
return FI_SUCCESS;
}

static int
static ssize_t
vrb_eq_xrc_connected_event(struct vrb_eq *eq,
struct rdma_cm_event *cma_event, int *acked,
struct fi_eq_cm_entry *entry, size_t len,
uint32_t *event)
{
struct vrb_xrc_ep *ep;
fid_t fid = cma_event->id->context;
int ret;
ssize_t ret;

ep = container_of(fid, struct vrb_xrc_ep, base_ep.util_ep.ep_fid);

Expand Down

0 comments on commit 75fe16c

Please sign in to comment.