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 03e7037..f53823b 100644 --- a/drv/hisi_sec.c +++ b/drv/hisi_sec.c @@ -2069,6 +2069,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: @@ -2638,6 +2640,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: