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