34 lines
1.1 KiB
Diff
34 lines
1.1 KiB
Diff
From 7869d42227f03754e4117a17751e6959b3f93bca Mon Sep 17 00:00:00 2001
|
|
From: Zhiqi Song <songzhiqi1@huawei.com>
|
|
Date: Mon, 11 Mar 2024 18:07:23 +0800
|
|
Subject: [PATCH 14/44] uadk: fix control range of environmemt variable
|
|
|
|
Environment variable will not be used in non-hardware
|
|
situation to config the ctx num. So add an interception
|
|
condition to avoid the impact of environment variables
|
|
on the initialization of non-hardware situations.
|
|
|
|
Signed-off-by: Zhiqi Song <songzhiqi1@huawei.com>
|
|
---
|
|
wd_util.c | 3 ++-
|
|
1 file changed, 2 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/wd_util.c b/wd_util.c
|
|
index 39909ca..b8e755c 100644
|
|
--- a/wd_util.c
|
|
+++ b/wd_util.c
|
|
@@ -2111,8 +2111,9 @@ int wd_ctx_param_init(struct wd_ctx_params *ctx_params,
|
|
return -WD_ENOMEM;
|
|
}
|
|
|
|
+ /* Only hw driver support environment variable */
|
|
var_s = secure_getenv(env_name);
|
|
- if (var_s && strlen(var_s)) {
|
|
+ if (var_s && strlen(var_s) && driver->calc_type == UADK_ALG_HW) {
|
|
/* environment variable has the highest priority */
|
|
ret = wd_env_set_ctx_nums(driver->alg_name, env_name, var_s,
|
|
ctx_params, max_op_type);
|
|
--
|
|
2.25.1
|
|
|