DPDK patches and discussions
 help / color / mirror / Atom feed
From: Piotr Bronowski <piotrx.bronowski@intel.com>
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 <piotrx.bronowski@intel.com>
Subject: [PATCH] crypto/ipsec_mb: fix premature dereference
Date: Sun, 16 Jan 2022 19:40:43 +0000	[thread overview]
Message-ID: <20220116194043.1388372-1-piotrx.bronowski@intel.com> (raw)

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 <piotrx.bronowski@intel.com>
---
 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.


             reply	other threads:[~2022-01-16 19:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-16 19:40 Piotr Bronowski [this message]
2022-02-08 21:21 ` [EXT] " Akhil Goyal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220116194043.1388372-1-piotrx.bronowski@intel.com \
    --to=piotrx.bronowski@intel.com \
    --cc=declan.doherty@intel.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=gakhil@marvell.com \
    --cc=roy.fan.zhang@intel.com \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).