[v2,1/3] net/ixgbe: set pointer to NULL after free

Message ID 652bd4da8f728423eca3554b13f26e5838b96d6b.1644927269.git.wangyunjian@huawei.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series fixes for ixgbe/txgbe/iavf |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Yunjian Wang Feb. 15, 2022, 1:01 p.m. UTC
  When ixgbe_dev_close() is cleaning up, it does not correctly set
the security_ctx variable to NULL, which will lead to wild pointer.

Fixes: 9a0752f498d2 ("net/ixgbe: enable inline IPsec")
Cc: stable@dpdk.org

Acked-by: Haiyue Wang <haiyue.wang@intel.com>
Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 1 +
 1 file changed, 1 insertion(+)
  

Patch

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 3d799d2187..7643842560 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -3038,6 +3038,7 @@  ixgbe_dev_close(struct rte_eth_dev *dev)
 
 #ifdef RTE_LIB_SECURITY
 	rte_free(dev->security_ctx);
+	dev->security_ctx = NULL;
 #endif
 
 	return ret;