From: Yunjian Wang Date: Tue, 15 Feb 2022 13:02:27 +0000 (+0800) Subject: net/iavf: reset security context pointer on stop X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=23abab4f14d3e2425e74c296769d21b79d696096;p=dpdk.git 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 --- 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; }