代码拉取完成,页面将自动刷新
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
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。