From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7CD3DA04A2; Sun, 16 Jan 2022 20:41:51 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CCA69410E8; Sun, 16 Jan 2022 20:41:48 +0100 (CET) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id A2C5840683 for ; Sun, 16 Jan 2022 20:41:46 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1642362106; x=1673898106; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=JEZRXG+8Ao8atOvGFBkzTxVl4Yz4mVkoyQAoBtiEaEU=; b=ObpmntuUg+fqSvDyEdJ468W9n0STCjMFGQ9bMZmKPEtyfujjiHfo8Ff7 BrONjGnZdw3KDyAqD39fORC0Xzpc2atkolI0c5Tj7aswUBvsA4B6rxauE fwwysaLPB6NQpGqqwZxQCDGSy6cOpQIcYlHrLNXiv0CATugilufHpogqV 23sTdRPk6kC2t1dgpAm1Y720OfcNI4tQLA3nYAhfHWdrnrhb8ikfvenps Te4U2AvHoO7Hx7a2xQvBfykuuFCUnNVrh4IBCgRivdUZ+SICC2BBj4xo9 tvkvINkGi9rwPxhx0il8y48iJl+gh6UN8R/yoFpN1tvf8tJNz0ZZo6+90 A==; X-IronPort-AV: E=McAfee;i="6200,9189,10229"; a="225194444" X-IronPort-AV: E=Sophos;i="5.88,293,1635231600"; d="scan'208";a="225194444" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jan 2022 11:41:45 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,293,1635231600"; d="scan'208";a="531068184" Received: from silpixa00400320.ir.intel.com ([10.237.214.242]) by orsmga008.jf.intel.com with ESMTP; 16 Jan 2022 11:41:43 -0800 From: Piotr Bronowski To: dev@dpdk.org Cc: roy.fan.zhang@intel.com, thomas@monjalon.net, gakhil@marvell.com, ferruh.yigit@intel.com, declan.doherty@intel.com, Piotr Bronowski Subject: [PATCH] crypto/ipsec_mb: fix premature dereference Date: Sun, 16 Jan 2022 19:40:43 +0000 Message-Id: <20220116194043.1388372-1-piotrx.bronowski@intel.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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 This patch removes coverity defect CID 374380: Null pointer dereferences (REVERSE_INULL) Coverity issue: CID 374380 Fixes: 918fd2f1466b ("crypto/ipsec_mb: move aesni_mb PMD") Cc: roy.fan.zhang@intel.com Signed-off-by: Piotr Bronowski --- drivers/crypto/ipsec_mb/ipsec_mb_private.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/ipsec_mb/ipsec_mb_private.h b/drivers/crypto/ipsec_mb/ipsec_mb_private.h index 866722d6f4..e53101acf1 100644 --- a/drivers/crypto/ipsec_mb/ipsec_mb_private.h +++ b/drivers/crypto/ipsec_mb/ipsec_mb_private.h @@ -191,13 +191,13 @@ ipsec_mb_parse_xform(const struct rte_crypto_sym_xform *xform, const struct rte_crypto_sym_xform **cipher_xform, const struct rte_crypto_sym_xform **aead_xform) { - const struct rte_crypto_sym_xform *next = xform->next; - if (xform == NULL) { *mode = IPSEC_MB_OP_NOT_SUPPORTED; return -ENOTSUP; } + const struct rte_crypto_sym_xform *next = xform->next; + if (xform->type == RTE_CRYPTO_SYM_XFORM_CIPHER) { if (next == NULL) { if (xform->cipher.op == RTE_CRYPTO_CIPHER_OP_ENCRYPT) { -- 2.30.2 -------------------------------------------------------------- Intel Research and Development Ireland Limited Registered in Ireland Registered Office: Collinstown Industrial Park, Leixlip, County Kildare Registered Number: 308263 This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.