
When sending message, 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_ecc_async'. Signed-off-by: Weili Qian <qianweili@huawei.com> --- wd_ecc.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/wd_ecc.c b/wd_ecc.c index 0c17cc3..086addb 100644 --- a/wd_ecc.c +++ b/wd_ecc.c @@ -2150,13 +2150,9 @@ int wd_do_ecc_async(handle_t sess, struct wd_ecc_req *req) goto fail_with_msg; msg->tag = mid; - pthread_spin_lock(&ctx->lock); ret = ecc_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_ecc_env_config, idx); if (ret) -- 2.33.0