From 2366ff7e765c5c451ab761cd0f9f9f6fbde4add3 Mon Sep 17 00:00:00 2001 From: Zhangfei Gao Date: Thu, 1 Feb 2024 14:25:14 +0000 Subject: [PATCH 18/44] wd_rsa: fix wd_rsa_common_uninit re-entry Fix wd_rsa_common_uninit re-entry Fixs: 3fc344a drivers alloc and free resources by themself Signed-off-by: Zhangfei Gao --- wd_rsa.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/wd_rsa.c b/wd_rsa.c index de0b796..8e51177 100644 --- a/wd_rsa.c +++ b/wd_rsa.c @@ -167,6 +167,12 @@ out_clear_ctx_config: static int wd_rsa_common_uninit(void) { + enum wd_status status; + + wd_alg_get_init(&wd_rsa_setting.status, &status); + if (status == WD_UNINIT) + return -WD_EINVAL; + /* uninit async request pool */ wd_uninit_async_request_pool(&wd_rsa_setting.pool); -- 2.25.1