Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
vmw_pvrdma: Avoid double unlock on qp->sq.lock
qp->sq.lock is currently unlocked twice when the ring state is invalid.
Fix this by removing the goto, and also set bad_wr correctly.

Fixes: 36756a6 ("libpvrdma: Add queue pair functions")
Cc: stable@linux-rdma.org
Reviewed-by: Vishnu Dasa <vdasa@vmware.com>
Reviewed-by: Adit Ranadive <aditr@vmware.com>
Reviewed-by: Rajesh Jalisatgi <rjalisatgi@vmware.com>
Signed-off-by: Bryan Tan <bryantan@vmware.com>
  • Loading branch information
bryantan-vmware committed Feb 13, 2020
1 parent ee7ea8b commit d8a052e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions providers/vmw_pvrdma/qp.c
Expand Up @@ -459,11 +459,12 @@ int pvrdma_post_send(struct ibv_qp *ibqp, struct ibv_send_wr *wr,
}

pthread_spin_lock(&qp->sq.lock);

ind = pvrdma_idx(&(qp->sq.ring_state->prod_tail), qp->sq.wqe_cnt);
if (ind < 0) {
pthread_spin_unlock(&qp->sq.lock);
ret = EINVAL;
goto out;
*bad_wr = wr;
return EINVAL;
}

for (nreq = 0; wr; ++nreq, wr = wr->next) {
Expand Down

0 comments on commit d8a052e

Please sign in to comment.