37 lines
1.1 KiB
Diff
37 lines
1.1 KiB
Diff
From 9cb01d217d9963c1e3a7a56f91528e3dbe6e28c7 Mon Sep 17 00:00:00 2001
|
|
From: Zhiqi Song <songzhiqi1@huawei.com>
|
|
Date: Sat, 25 Nov 2023 16:13:26 +0800
|
|
Subject: [PATCH 75/82] v1/pkey: add check of qlist
|
|
|
|
Add null pointer check of 'eng_ctx->qlist'.
|
|
|
|
Signed-off-by: Zhiqi Song <songzhiqi1@huawei.com>
|
|
---
|
|
src/v1/alg/pkey/hpre_wd.c | 9 ++++++---
|
|
1 file changed, 6 insertions(+), 3 deletions(-)
|
|
|
|
diff --git a/src/v1/alg/pkey/hpre_wd.c b/src/v1/alg/pkey/hpre_wd.c
|
|
index 971f7b2..855d47c 100644
|
|
--- a/src/v1/alg/pkey/hpre_wd.c
|
|
+++ b/src/v1/alg/pkey/hpre_wd.c
|
|
@@ -157,10 +157,13 @@ void hpre_free_eng_ctx(hpre_engine_ctx_t *eng_ctx)
|
|
}
|
|
|
|
if (eng_ctx->opdata.op_type != WCRYPTO_RSA_GENKEY) {
|
|
- if (eng_ctx->opdata.in)
|
|
- eng_ctx->rsa_setup.br.free(eng_ctx->qlist->kae_queue_mem_pool, eng_ctx->opdata.in);
|
|
+ if (eng_ctx->opdata.in) {
|
|
+ if (eng_ctx->qlist)
|
|
+ eng_ctx->rsa_setup.br.free(eng_ctx->qlist->kae_queue_mem_pool, eng_ctx->opdata.in);
|
|
+ }
|
|
+
|
|
if (eng_ctx->opdata.out) {
|
|
- if (eng_ctx->qlist != NULL)
|
|
+ if (eng_ctx->qlist)
|
|
eng_ctx->rsa_setup.br.free(eng_ctx->qlist->kae_queue_mem_pool, eng_ctx->opdata.out);
|
|
}
|
|
} else {
|
|
--
|
|
2.25.1
|
|
|