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

Message ID 20221121080049.3850133-3-yebin@huaweicloud.com
State New
Headers
Series Fix error handle in 'rdma_request()' |

Commit Message

Ye Bin Nov. 21, 2022, 8 a.m. UTC
  From: Ye Bin <yebin10@huawei.com>

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@huawei.com>
---
 net/9p/trans_rdma.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
  

Patch

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;