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: 080e3c0ee9 ("net/ixgbe: store flow director filter")
Fixes: d0c0c416ef ("net/ixgbe: store L2 tunnel filter")
Cc: stable@dpdk.org

Signed-off-by: Qiming Chen <chenqiming_huawei@163.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
This commit is contained in:
Qiming Chen 2021-08-31 21:24:07 +08:00 committed by Qi Zhang
parent 1a86f4dbdf
commit 03f83d6c5c

View File

@ -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;