38 lines
1.1 KiB
Diff
38 lines
1.1 KiB
Diff
From 4ee1811e3dd7dc22946204f239448b901df075a7 Mon Sep 17 00:00:00 2001
|
|
From: Qi Tao <taoqi10@huawei.com>
|
|
Date: Thu, 30 Nov 2023 17:14:45 +0800
|
|
Subject: [PATCH 104/123] uadk/sec: add a return value judgement
|
|
|
|
Add return value judgement of aead_get_aes_key_len().
|
|
|
|
Signed-off-by: Zhiqi Song <songzhiqi1@huawei.com>
|
|
---
|
|
drv/hisi_sec.c | 4 ++++
|
|
1 file changed, 4 insertions(+)
|
|
|
|
diff --git a/drv/hisi_sec.c b/drv/hisi_sec.c
|
|
index 14952e7..4421dfc 100644
|
|
--- a/drv/hisi_sec.c
|
|
+++ b/drv/hisi_sec.c
|
|
@@ -2153,6 +2153,8 @@ static int fill_aead_bd2_alg(struct wd_aead_msg *msg,
|
|
case WD_CIPHER_AES:
|
|
sqe->type2.c_alg = C_ALG_AES;
|
|
ret = aead_get_aes_key_len(msg, &c_key_len);
|
|
+ if (ret)
|
|
+ return ret;
|
|
sqe->type2.icvw_kmode = (__u16)c_key_len << SEC_CKEY_OFFSET;
|
|
break;
|
|
default:
|
|
@@ -2722,6 +2724,8 @@ static int fill_aead_bd3_alg(struct wd_aead_msg *msg,
|
|
case WD_CIPHER_AES:
|
|
sqe->c_mode_alg |= C_ALG_AES << SEC_CALG_OFFSET_V3;
|
|
ret = aead_get_aes_key_len(msg, &c_key_len);
|
|
+ if (ret)
|
|
+ return ret;
|
|
sqe->c_icv_key |= (__u16)c_key_len << SEC_CKEY_OFFSET_V3;
|
|
break;
|
|
default:
|
|
--
|
|
2.31.1.windows.1
|
|
|