
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 4d92ad5..de24ea5 100644 --- a/wd_dh.c +++ b/wd_dh.c @@ -322,13 +322,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.33.0