crypto/ipsec_mb: fix null pointer dereference
Checks
Commit Message
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(-)
Comments
> 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>
> ---
This patch is a duplicate of a patch already submitted.
http://patches.dpdk.org/project/dpdk/patch/20220116194043.1388372-1-piotrx.bronowski@intel.com/
@@ -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) {