summaryrefslogtreecommitdiff
path: root/drivers/infiniband
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2021-06-25 16:03:06 +0300
committerJason Gunthorpe <jgg@nvidia.com>2021-06-25 18:00:28 +0300
commit36941dfe0e8c3e2da7851b9648fd74bd3a3e78ce (patch)
tree87d0dd4d4f8de72d57cf6c4583b9e28cbc02b955 /drivers/infiniband
parent74f160ead74bfe5f2b38afb4fcf86189f9ff40c9 (diff)
downloadlinux-36941dfe0e8c3e2da7851b9648fd74bd3a3e78ce.tar.xz
RDMA/rxe: Missing unlock on error in get_srq_wqe()
This error path needs to unlock before returning. Fixes: ec0fa2445c18 ("RDMA/rxe: Fix over copying in get_srq_wqe") Link: https://lore.kernel.org/r/YNXUCmnPsSkPyhkm@mwanda Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Majd Dibbiny <majd@nvidia.com> Reviewed-by: Bob Pearson <rpearsonhpe@gmail.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/sw/rxe/rxe_resp.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/infiniband/sw/rxe/rxe_resp.c b/drivers/infiniband/sw/rxe/rxe_resp.c
index 72cdb170b67b..3743dc39b60c 100644
--- a/drivers/infiniband/sw/rxe/rxe_resp.c
+++ b/drivers/infiniband/sw/rxe/rxe_resp.c
@@ -314,6 +314,7 @@ static enum resp_states get_srq_wqe(struct rxe_qp *qp)
/* don't trust user space data */
if (unlikely(wqe->dma.num_sge > srq->rq.max_sge)) {
+ spin_unlock_bh(&srq->rq.consumer_lock);
pr_warn("%s: invalid num_sge in SRQ entry\n", __func__);
return RESPST_ERR_MALFORMED_WQE;
}