From 23abab4f14d3e2425e74c296769d21b79d696096 Mon Sep 17 00:00:00 2001 From: Yunjian Wang Date: Tue, 15 Feb 2022 21:02:27 +0800 Subject: [PATCH] net/iavf: reset security context pointer on stop When iavf_security_ctx_destroy() is cleaning up, it does not correctly set the security_ctx variable to NULL, which will lead to wild pointer. Fixes: 6bc987ecb860 ("net/iavf: support IPsec inline crypto") Cc: stable@dpdk.org Signed-off-by: Yunjian Wang Reviewed-by: Ferruh Yigit --- drivers/net/iavf/iavf_ipsec_crypto.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/iavf/iavf_ipsec_crypto.c b/drivers/net/iavf/iavf_ipsec_crypto.c index 6ac1b213db..a63e42f29a 100644 --- a/drivers/net/iavf/iavf_ipsec_crypto.c +++ b/drivers/net/iavf/iavf_ipsec_crypto.c @@ -1553,8 +1553,8 @@ iavf_security_ctx_destroy(struct iavf_adapter *adapter) rte_free(iavf_sctx); rte_free(sctx); - iavf_sctx = NULL; - sctx = NULL; + adapter->security_ctx = NULL; + adapter->vf.eth_dev->security_ctx = NULL; return 0; } -- 2.39.5