]> git.droids-corp.org - dpdk.git/commitdiff
crypto/ipsec_mb: fix premature dereference
authorPiotr Bronowski <piotrx.bronowski@intel.com>
Sun, 16 Jan 2022 19:40:43 +0000 (19:40 +0000)
committerAkhil Goyal <gakhil@marvell.com>
Sat, 12 Feb 2022 09:26:38 +0000 (10:26 +0100)
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 <piotrx.bronowski@intel.com>
drivers/crypto/ipsec_mb/ipsec_mb_private.h

index 866722d6f4b6998421aff9f34c78558449db6b8d..e53101acf17860488c4226ff6182e209ec924c4d 100644 (file)
@@ -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) {