49 lines
1.2 KiB
Diff
49 lines
1.2 KiB
Diff
From 8c0420608a4655cdc519e91f1e126d567529eda3 Mon Sep 17 00:00:00 2001
|
|
From: Zhiqi Song <songzhiqi1@huawei.com>
|
|
Date: Sat, 9 Dec 2023 14:50:37 +0800
|
|
Subject: [PATCH 121/123] uadk - fix uninit task queue
|
|
|
|
Fix uninit wrong task queue on error branch.
|
|
|
|
Singed-off-by: Zhiqi Song <songzhiqi1@huawei.com>
|
|
---
|
|
wd_util.c | 17 +++++++++++------
|
|
1 file changed, 11 insertions(+), 6 deletions(-)
|
|
|
|
diff --git a/wd_util.c b/wd_util.c
|
|
index 24e1094..529c42e 100644
|
|
--- a/wd_util.c
|
|
+++ b/wd_util.c
|
|
@@ -1570,17 +1570,22 @@ static int wd_init_async_polling_thread_per_numa(struct wd_env_config *config,
|
|
task_queue = queue_head;
|
|
for (i = 0; i < num; task_queue++, i++) {
|
|
ret = wd_init_one_task_queue(task_queue, alg_poll_ctx);
|
|
- if (ret) {
|
|
- for (j = 0; j < i; task_queue++, j++)
|
|
- wd_uninit_one_task_queue(task_queue);
|
|
- free(queue_head);
|
|
- return ret;
|
|
- }
|
|
+ if (ret)
|
|
+ goto uninit_queue;
|
|
}
|
|
|
|
config_numa->async_task_queue_array = (void *)queue_head;
|
|
|
|
return 0;
|
|
+
|
|
+uninit_queue:
|
|
+ task_queue = queue_head;
|
|
+ for (j = 0; j < i; task_queue++, j++)
|
|
+ wd_uninit_one_task_queue(task_queue);
|
|
+
|
|
+ free(queue_head);
|
|
+
|
|
+ return ret;
|
|
}
|
|
|
|
static void wd_uninit_async_polling_thread_per_numa(struct wd_env_config *cfg,
|
|
--
|
|
2.31.1.windows.1
|
|
|