Skip to contentSkip to conversation

net/ixgbe: fix hash handle leak

PATCH Applied Qiming Chen 2 participants 2 messages Aug 31, 2021 – Sep 6, 2021 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/ixgbe: fix hash handle leak

In the ixgbe_fdir_filter_init and ixgbe_l2_tn_filter_init functions, after the hash handle is created, the handle is not released in subsequent abnormal branches.

Fixes 080e3c0ee989 ("net/ixgbe: store flow director filter")
Fixes d0c0c416ef1f ("net/ixgbe: store L2 tunnel filter")
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/ixgbe/ixgbe_ethdev.c +2 -0
index ccb01ed344..3fd3249150 100644
@@ -1393,6 +1393,7 @@ static int ixgbe_fdir_filter_init(struct rte_eth_dev *eth_dev)
 	if (!fdir_info->hash_map) {
 		PMD_INIT_LOG(ERR,
 			     "Failed to allocate memory for fdir hash map!");
+		rte_hash_free(fdir_info->hash_handle);
 		return -ENOMEM;
 	}
 	fdir_info->mask_added = FALSE;
@@ -1429,6 +1430,7 @@ static int ixgbe_l2_tn_filter_init(struct rte_eth_dev *eth_dev)
 	if (!l2_tn_info->hash_map) {
 		PMD_INIT_LOG(ERR,
 			"Failed to allocate memory for L2 TN hash map!");
+		rte_hash_free(l2_tn_info->hash_handle);
 		return -ENOMEM;
 	}
 	l2_tn_info->e_tag_en = FALSE;
Signature · 1 line
2.30.1.windows.1
Acked-by on v1 1/1 Applied
#1 lore raw
Quoted 10 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Qiming Chen
Sent: Tuesday, August 31, 2021 9:24 PM
To: [email protected]
Cc: Wang, Haiyue <[email protected]>; Qiming Chen <[email protected]>; [email protected]
Subject: [dpdk-dev] [PATCH] net/ixgbe: fix hash handle leak

Quoted 8 lines

In the ixgbe_fdir_filter_init and ixgbe_l2_tn_filter_init functions, after the hash handle is created, the handle is not released in subsequent abnormal branches.

Fixes 080e3c0ee989 ("net/ixgbe: store flow director filter")
Fixes d0c0c416ef1f ("net/ixgbe: store L2 tunnel filter")

Applied to dpdk-next-net-intel.

Thanks
Qi