From 6b02f3609923def84213d3a6e775fa45ddfae1b7 Mon Sep 17 00:00:00 2001
From: Weili Qian <qianweili@huawei.com>
Date: Tue, 31 May 2022 17:01:03 +0800
Subject: [PATCH 130/183] dh: remove the lock in async send

When sending task, a lock has been added in function 'hisi_qm_send'
to ensure atomicity, so there is no need to repeat lock in
function 'wd_do_dh_async'.

Signed-off-by: Weili Qian <qianweili@huawei.com>
---
 wd_dh.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/wd_dh.c b/wd_dh.c
index dfa9505..dd669f1 100644
--- a/wd_dh.c
+++ b/wd_dh.c
@@ -323,13 +323,9 @@ int wd_do_dh_async(handle_t sess, struct wd_dh_req *req)
 		goto fail_with_msg;
 	msg->tag = mid;
 
-	pthread_spin_lock(&ctx->lock);
 	ret = dh_send(ctx->ctx, msg);
-	if (ret) {
-		pthread_spin_unlock(&ctx->lock);
+	if (ret)
 		goto fail_with_msg;
-	}
-	pthread_spin_unlock(&ctx->lock);
 
 	ret = wd_add_task_to_async_queue(&wd_dh_env_config, idx);
 	if (ret)
-- 
2.27.0

