libwd/0019-wd_dh-Fix-wd_aead_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

33 lines
761 B
Diff

From 72d2f8d98ee7322463f66be3aa8dea7a9e0b0811 Mon Sep 17 00:00:00 2001
From: Zhangfei Gao <zhangfei.gao@linaro.org>
Date: Tue, 19 Mar 2024 02:37:51 +0000
Subject: [PATCH 19/44] wd_dh: Fix wd_aead_uninit re-entry
Check status for the re-entry
Signed-off-by: Zhangfei Gao <zhangfei.gao@linaro.org>
---
wd_dh.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/wd_dh.c b/wd_dh.c
index d23bb61..4d08de6 100644
--- a/wd_dh.c
+++ b/wd_dh.c
@@ -127,6 +127,12 @@ out_clear_ctx_config:
static int wd_dh_common_uninit(void)
{
+ enum wd_status status;
+
+ wd_alg_get_init(&wd_dh_setting.status, &status);
+ if (status == WD_UNINIT)
+ return -WD_EINVAL;
+
/* uninit async request pool */
wd_uninit_async_request_pool(&wd_dh_setting.pool);
--
2.25.1