]> git.droids-corp.org - dpdk.git/commitdiff
net/iavf: reset security context pointer on stop
authorYunjian Wang <wangyunjian@huawei.com>
Tue, 15 Feb 2022 13:02:27 +0000 (21:02 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Wed, 16 Feb 2022 14:16:53 +0000 (15:16 +0100)
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 <wangyunjian@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
drivers/net/iavf/iavf_ipsec_crypto.c

index 6ac1b213dbcca65cbba19212bf05ae1dae8407da..a63e42f29ad69d37fbbb2f49f364ad4bce1244f3 100644 (file)
@@ -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;
 }