From patchwork Wed Oct 11 07:18:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tejasree Kondoj X-Patchwork-Id: 132498 X-Patchwork-Delegate: gakhil@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id A2F0B4235C; Wed, 11 Oct 2023 09:18:32 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7196D402A2; Wed, 11 Oct 2023 09:18:32 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id B9E0B4028A for ; Wed, 11 Oct 2023 09:18:31 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 39B6RLu6020126; Wed, 11 Oct 2023 00:18:30 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=EOc2Tsc+yvxQviksdsIg6SS35gLpcr1KrgBeJgGZCOM=; b=fZ3JZHMzGBl5CVysUX+PPbD6OtOmM1xmawCUrm/PyEe0Q/wCBON6sV3c520CgaR3oYcm NNRSf/5wVr1C/pU0uWouzdbXqEi5iBaoPyQVNxI68llXgfO5CZRMnAYepb7Z0NvVuDUc Rv6ZqI5yNuG2hEVNznOfVuMLmRthxjo5QVjShar219IA15j+qUmMgdPgNGahyUpzf2nd Ze5PDlghymRBewYMx4rdcIA1MShZELdGvetSmWUo8ORiJMkFuY45YtadNjWaoX3eWkYa uVrcvw2u2lB72g4x3pZDNAwt5WY99YsflWB71LtAmCbXCuoIRLODGTeHgaTEn9m0mbxC eQ== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3tnc2at5ke-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 11 Oct 2023 00:18:30 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Wed, 11 Oct 2023 00:18:28 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.48 via Frontend Transport; Wed, 11 Oct 2023 00:18:28 -0700 Received: from hyd1554.marvell.com (unknown [10.29.57.11]) by maili.marvell.com (Postfix) with ESMTP id 766ED5B6936; Wed, 11 Oct 2023 00:18:26 -0700 (PDT) From: Tejasree Kondoj To: Akhil Goyal CC: Anoob Joseph , Thomas Monjalon , Aakash Sasidharan , Gowrishankar Muthukrishnan , Vidya Sagar Velumuri , Subject: [PATCH] crypto/cnxk: fix RISC-V compilation Date: Wed, 11 Oct 2023 12:48:25 +0530 Message-ID: <20231011071825.3416866-1-ktejasree@marvell.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Proofpoint-GUID: mGu_iQ4brXKrC74eI6W4rx3BHRZjjLkc X-Proofpoint-ORIG-GUID: mGu_iQ4brXKrC74eI6W4rx3BHRZjjLkc X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-10-11_04,2023-10-10_01,2023-05-22_02 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Fixing RISC-V compilation failure by adding check for NULL pointer. Fixes: 905537accdd1 ("crypto/cnxk: support raw APIs") Signed-off-by: Tejasree Kondoj --- drivers/crypto/cnxk/cnxk_se.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/crypto/cnxk/cnxk_se.h b/drivers/crypto/cnxk/cnxk_se.h index 5d138163f0..c2a807fa94 100644 --- a/drivers/crypto/cnxk/cnxk_se.h +++ b/drivers/crypto/cnxk/cnxk_se.h @@ -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);