Skip to content

Commit

Permalink
prov/sockets: Make sure cqerr_rb is locked when accessed
Browse files Browse the repository at this point in the history
Fix coverity missing lock

Signed-off-by: Zach Dworkin <[email protected]>
  • Loading branch information
zachdworkin committed Mar 22, 2024
1 parent f3ef333 commit 5b761c3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion prov/sockets/src/sock_wait.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,13 @@ static int sock_wait_wait(struct fid_wait *wait_fid, int timeout)
cq = container_of(list_item->fid,
struct sock_cq, cq_fid);
sock_cq_progress(cq);
pthread_mutex_lock(&cq->lock);
if (ofi_rbused(&cq->cqerr_rb))
return 1;
err = 1;

pthread_mutex_unlock(&cq->lock);
if (err)
return err;
break;

case FI_CLASS_CNTR:
Expand Down

0 comments on commit 5b761c3

Please sign in to comment.