[PATCH 2/5] 9p: fix miss release semaphore in 'rdma_request()'

From: Ye Bin
Date: Mon Nov 21 2022 - 02:39:44 EST


From: Ye Bin <yebin10@xxxxxxxxxx>

If send request failed will not call 'send_done()', but already get
'(&rdma->sq_sem'. So add release '(&rdma->sq_sem' after send request failed.

Signed-off-by: Ye Bin <yebin10@xxxxxxxxxx>
---
net/9p/trans_rdma.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/net/9p/trans_rdma.c b/net/9p/trans_rdma.c
index e498208ed72b..ae2bac9bf510 100644
--- a/net/9p/trans_rdma.c
+++ b/net/9p/trans_rdma.c
@@ -509,8 +509,10 @@ static int rdma_request(struct p9_client *client, struct p9_req_t *req)
*/
req->status = REQ_STATUS_SENT;
err = ib_post_send(rdma->qp, &wr, NULL);
- if (err)
+ if (err) {
+ up(&rdma->sq_sem);
goto mapping_error;
+ }

/* Success */
return 0;
--
2.31.1