Thread (5 messages) 5 messages, 4 authors, 2021-06-25

Re: [PATCH] RDMA/rxe: missing unlock on error in get_srq_wqe()

From: Bob Pearson <hidden>
Date: 2021-06-25 14:33:49
Also in: kernel-janitors

On 6/25/21 9:32 AM, Bob Pearson wrote:
On 6/25/21 8:03 AM, Dan Carpenter wrote:
quoted
This error path needs to unlock before returning.

Fixes: ec0fa2445c18 ("RDMA/rxe: Fix over copying in get_srq_wqe")
Signed-off-by: Dan Carpenter <redacted>
---
I'm sort of surprised this one wasn't caught in testing...

 drivers/infiniband/sw/rxe/rxe_resp.c | 1 +
 1 file changed, 1 insertion(+)
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;
 	}
This is correct. Thanks.
Bob Pearson 
Should say
Reviewed-by: Bob Pearson <redacted>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help