From: Piotr Bronowski Date: Sun, 16 Jan 2022 19:40:43 +0000 (+0000) Subject: crypto/ipsec_mb: fix premature dereference X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=8c60a04985e7fbee288e780c8d50373d3e1ec678;p=dpdk.git crypto/ipsec_mb: fix premature dereference 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: stable@dpdk.org Signed-off-by: Piotr Bronowski --- 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) {