libwd/0018-wd_rsa-fix-wd_rsa_common_uninit-re-entry.patch
JangShui Yang e072f742a4 libwd: update the source code
(cherry picked from commit dc42b3a676205c1a1c922628a993887e1ad2988f)
2024-04-07 18:59:45 +08:00

34 lines
838 B
Diff

From 2366ff7e765c5c451ab761cd0f9f9f6fbde4add3 Mon Sep 17 00:00:00 2001
From: Zhangfei Gao <zhangfei.gao@linaro.org>
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 <zhangfei.gao@linaro.org>
---
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