crypto/cnxk: fix RISC-V compilation
Checks
Commit Message
Fixing RISC-V compilation failure by adding check
for NULL pointer.
Fixes: 905537accdd1 ("crypto/cnxk: support raw APIs")
Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
---
drivers/crypto/cnxk/cnxk_se.h | 8 ++++++++
1 file changed, 8 insertions(+)
Comments
11/10/2023 09:18, Tejasree Kondoj:
> Fixing RISC-V compilation failure by adding check
> for NULL pointer.
>
> Fixes: 905537accdd1 ("crypto/cnxk: support raw APIs")
>
> Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Squashed in "crypto/cnxk: support raw APIs", thank you.
@@ -1834,6 +1834,10 @@ cpt_kasumi_enc_prep(uint32_t req_flags, uint64_t d_offs, uint64_t d_lens,
cpt_inst_w4.s.param2 = auth_data_len;
inst->w4.u64 = cpt_inst_w4.u64;
+
+ if (unlikely(iv_s == NULL))
+ return -1;
+
if (is_sg_ver2)
sg2_inst_prep(params, inst, offset_ctrl, iv_s, iv_len, 0, 0, inputlen, outputlen, 0,
req_flags, 0, 0);
@@ -1890,6 +1894,10 @@ cpt_kasumi_dec_prep(uint64_t d_offs, uint64_t d_lens, struct roc_se_fc_params *p
}
inst->w4.u64 = cpt_inst_w4.u64;
+
+ if (unlikely(params->iv_buf == NULL))
+ return -1;
+
if (is_sg_ver2)
sg2_inst_prep(params, inst, offset_ctrl, params->iv_buf, iv_len, 0, 0, inputlen,
outputlen, 0, 0, 0, 1);