libwd/0074-uadk_tool-initialize-the-return-value-ret-of-the-fun.patch
2023-11-23 10:41:04 +08:00

46 lines
1.3 KiB
Diff

From 1628e0964d25ff490bb98d5de31338603420ce56 Mon Sep 17 00:00:00 2001
From: Qi Tao <taoqi10@huawei.com>
Date: Fri, 10 Nov 2023 11:52:43 +0800
Subject: [PATCH 74/85] uadk_tool: initialize the return value 'ret' of the
function
'ret' was used uninitialized in function init_ctx_config().
Signed-off-by: Qi Tao <taoqi10@huawei.com>
---
uadk_tool/benchmark/sec_uadk_benchmark.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/uadk_tool/benchmark/sec_uadk_benchmark.c b/uadk_tool/benchmark/sec_uadk_benchmark.c
index d6effe5..f1ae18b 100644
--- a/uadk_tool/benchmark/sec_uadk_benchmark.c
+++ b/uadk_tool/benchmark/sec_uadk_benchmark.c
@@ -516,12 +516,14 @@ static int sec_uadk_param_parse(thread_data *tddata, struct acc_option *options)
static int init_ctx_config(struct acc_option *options)
{
- struct sched_params param;
+ struct sched_params param = {0};
struct uacce_dev *dev = NULL;
char *alg = options->algclass;
int subtype = options->subtype;
int mode = options->syncmode;
- int ret, max_node, i;
+ int max_node = 0;
+ int ret = 0;
+ int i = 0;
max_node = numa_max_node() + 1;
if (max_node <= 0)
@@ -533,7 +535,6 @@ static int init_ctx_config(struct acc_option *options)
if (!g_ctx_cfg.ctxs)
return -ENOMEM;
- i = 0;
while (i < g_ctxnum) {
dev = wd_get_accel_dev(alg);
if (!dev) {
--
2.25.1