DPDK patches and discussions
 help / color / mirror / Atom feed
From: Weiguo Li <liwg06@foxmail.com>
To: roy.fan.zhang@intel.com
Cc: piotrx.bronowski@intel.com, dev@dpdk.org
Subject: [PATCH] crypto/ipsec_mb: fix null pointer dereference
Date: Sun, 30 Jan 2022 00:30:47 +0800	[thread overview]
Message-ID: <tencent_7E11AE18371EF353FD88339DCBEFB7113C07@qq.com> (raw)

Adjust memory check and use in a proper order to avoid
null pointer dereference.

Fixes: 918fd2f1466b ("crypto/ipsec_mb: move aesni_mb PMD")

Signed-off-by: Weiguo Li <liwg06@foxmail.com>
---
 drivers/crypto/ipsec_mb/ipsec_mb_private.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/crypto/ipsec_mb/ipsec_mb_private.h b/drivers/crypto/ipsec_mb/ipsec_mb_private.h
index 866722d6f4..cae8f68988 100644
--- a/drivers/crypto/ipsec_mb/ipsec_mb_private.h
+++ b/drivers/crypto/ipsec_mb/ipsec_mb_private.h
@@ -191,12 +191,11 @@ 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) {
-- 
2.25.1


             reply	other threads:[~2022-01-29 16:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-29 16:30 Weiguo Li [this message]
2022-02-08 21:44 ` [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=tencent_7E11AE18371EF353FD88339DCBEFB7113C07@qq.com \
    --to=liwg06@foxmail.com \
    --cc=dev@dpdk.org \
    --cc=piotrx.bronowski@intel.com \
    --cc=roy.fan.zhang@intel.com \
    /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).