Projects
Eulaceura:Mainline:GA
libwd
_service:obs_scm:0022-wd_aead-uninit-check-stat...
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:obs_scm:0022-wd_aead-uninit-check-status-in-one-func.patch of Package libwd
From e726680f9c8c9bfcf143d529be34d5b7ce2157be Mon Sep 17 00:00:00 2001 From: Zhangfei Gao <zhangfei.gao@linaro.org> Date: Tue, 19 Mar 2024 02:44:21 +0000 Subject: [PATCH 22/44] wd_aead: uninit check status in one func To simplify code, checking status in one func Signed-off-by: Zhangfei Gao <zhangfei.gao@linaro.org> --- wd_aead.c | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/wd_aead.c b/wd_aead.c index 34a3b86..57daa80 100644 --- a/wd_aead.c +++ b/wd_aead.c @@ -485,23 +485,30 @@ out_clear_init: return ret; } -static void wd_aead_uninit_nolock(void) +static int wd_aead_uninit_nolock(void) { + enum wd_status status; + + wd_alg_get_init(&wd_aead_setting.status, &status); + if (status == WD_UNINIT) + return -WD_EINVAL; + wd_uninit_async_request_pool(&wd_aead_setting.pool); wd_clear_sched(&wd_aead_setting.sched); wd_alg_uninit_driver(&wd_aead_setting.config, wd_aead_setting.driver); + + return 0; } void wd_aead_uninit(void) { - enum wd_status status; + int ret; - wd_alg_get_init(&wd_aead_setting.status, &status); - if (status == WD_UNINIT) + ret = wd_aead_uninit_nolock(); + if (ret) return; - wd_aead_uninit_nolock(); wd_aead_close_driver(); wd_alg_clear_init(&wd_aead_setting.status); } @@ -614,13 +621,12 @@ out_uninit: void wd_aead_uninit2(void) { - enum wd_status status; + int ret; - wd_alg_get_init(&wd_aead_setting.status, &status); - if (status == WD_UNINIT) + ret = wd_aead_uninit_nolock(); + if (ret) return; - wd_aead_uninit_nolock(); wd_alg_attrs_uninit(&wd_aead_init_attrs); wd_alg_drv_unbind(wd_aead_setting.driver); wd_dlclose_drv(wd_aead_setting.dlh_list); -- 2.25.1
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2