mailweb.openeuler.org
Manage this list

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

Acc

Threads by month
  • ----- 2025 -----
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
acc@openeuler.org

May 2025

  • 1 participants
  • 1 discussions
[PATCH] [acc/uadk_tool] Modify malloc for queue init
by Qi Tao 08 May '25

08 May '25
From: Junchong Pan <panjunchong(a)h-partners.com> Queue is malloc but not init, is_poll is set but poll interface is not invoked, may case eq overflow. Signed-off-by: Junchong Pan <panjunchong(a)h-partners.com> Signed-off-by: Qi Tao <taoqi10(a)huawei.com> --- uadk_tool/benchmark/hpre_wd_benchmark.c | 2 +- uadk_tool/benchmark/sec_wd_benchmark.c | 2 +- uadk_tool/benchmark/zip_wd_benchmark.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/uadk_tool/benchmark/hpre_wd_benchmark.c b/uadk_tool/benchmark/hpre_wd_benchmark.c index 40f7f0b..60ed3bd 100644 --- a/uadk_tool/benchmark/hpre_wd_benchmark.c +++ b/uadk_tool/benchmark/hpre_wd_benchmark.c @@ -447,7 +447,7 @@ static int init_hpre_wd_queue(struct acc_option *options) } for (i = 0; i < g_thread_num; i++) { - g_thread_queue.bd_res[i].queue = malloc(sizeof(struct wd_queue)); + g_thread_queue.bd_res[i].queue = calloc(1, sizeof(struct wd_queue)); g_thread_queue.bd_res[i].queue->capa.alg = options->algclass; // 0 is ENC, 1 is DEC g_thread_queue.bd_res[i].queue->capa.priv.direction = options->optype; diff --git a/uadk_tool/benchmark/sec_wd_benchmark.c b/uadk_tool/benchmark/sec_wd_benchmark.c index e022dcb..f066a5b 100644 --- a/uadk_tool/benchmark/sec_wd_benchmark.c +++ b/uadk_tool/benchmark/sec_wd_benchmark.c @@ -610,7 +610,7 @@ static int init_wd_queue(struct acc_option *options) } for (i = 0; i < g_thread_num; i++) { - g_thread_queue.bd_res[i].queue = malloc(sizeof(struct wd_queue)); + g_thread_queue.bd_res[i].queue = calloc(1, sizeof(struct wd_queue)); memset(g_thread_queue.bd_res[i].queue, 0, sizeof(struct wd_queue)); g_thread_queue.bd_res[i].queue->capa.alg = options->algclass; // 0 is ENC, 1 is DEC diff --git a/uadk_tool/benchmark/zip_wd_benchmark.c b/uadk_tool/benchmark/zip_wd_benchmark.c index 8ad3e96..ab9a894 100644 --- a/uadk_tool/benchmark/zip_wd_benchmark.c +++ b/uadk_tool/benchmark/zip_wd_benchmark.c @@ -311,7 +311,7 @@ static int init_zip_wd_queue(struct acc_option *options) } for (i = 0; i < g_thread_num; i++) { - g_thread_queue.bd_res[i].queue = malloc(sizeof(struct wd_queue)); + g_thread_queue.bd_res[i].queue = calloc(1, sizeof(struct wd_queue)); g_thread_queue.bd_res[i].queue->capa.alg = options->algclass; // 0 is compress, 1 is decompress g_thread_queue.bd_res[i].queue->capa.priv.direction = op_type; -- 2.33.0
1 1
0 0

HyperKitty Powered by HyperKitty