Move the resource release into lock.
Signed-off-by: Yang Shen shenyang39@huawei.com --- v1/wd_comp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/v1/wd_comp.c b/v1/wd_comp.c index f898c1d..fb9e413 100644 --- a/v1/wd_comp.c +++ b/v1/wd_comp.c @@ -192,8 +192,8 @@ free_ctx_buf: free(ctx); free_ctx_id: wd_free_id(qinfo->ctx_id, WD_MAX_CTX_NUM, ctx_id, WD_MAX_CTX_NUM); - wd_spinlock(&qinfo->qlock); qinfo->ctx_num--; + wd_spinlock(&qinfo->qlock); unlock: wd_unspinlock(&qinfo->qlock); return NULL;