* [PATCH] crypto/ipsec_mb: fix null pointer dereference
@ 2022-01-29 16:30 Weiguo Li
2022-02-08 21:44 ` [EXT] " Akhil Goyal
0 siblings, 1 reply; 2+ messages in thread
From: Weiguo Li @ 2022-01-29 16:30 UTC (permalink / raw)
To: roy.fan.zhang; +Cc: piotrx.bronowski, dev
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-02-08 21:44 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-29 16:30 [PATCH] crypto/ipsec_mb: fix null pointer dereference Weiguo Li
2022-02-08 21:44 ` [EXT] " Akhil Goyal
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).