When the 'alg_name' set by the user is valid, the 'env_enabled' field should be set or returned.
Fixes: 3c0c996ef1b43("uadk_engine:fix string compare mode") Signed-off-by: Zhiqi Song songzhiqi1@huawei.com --- src/e_uadk.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/e_uadk.c b/src/e_uadk.c index 5aaf113..f879870 100644 --- a/src/e_uadk.c +++ b/src/e_uadk.c @@ -115,7 +115,7 @@ int uadk_e_is_env_enabled(const char *alg_name) int i = 0;
while (i < len) { - if (strcmp(uadk_env_enabled[i].alg_name, alg_name)) + if (!strcmp(uadk_env_enabled[i].alg_name, alg_name)) return uadk_env_enabled[i].env_enabled; i++; } @@ -129,7 +129,7 @@ static void uadk_e_set_env_enabled(const char *alg_name, __u8 value) int i = 0;
while (i < len) { - if (strcmp(uadk_env_enabled[i].alg_name, alg_name)) { + if (!strcmp(uadk_env_enabled[i].alg_name, alg_name)) { uadk_env_enabled[i].env_enabled = value; return; }