Skip to content

Commit

Permalink
net/ixgbe: fix hash handle leak
Browse files Browse the repository at this point in the history
[ upstream commit 03f83d6 ]

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: 080e3c0 ("net/ixgbe: store flow director filter")
Fixes: d0c0c41 ("net/ixgbe: store L2 tunnel filter")

Signed-off-by: Qiming Chen <chenqiming_huawei@163.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
  • Loading branch information
Qiming Chen authored and cpaelzer committed Nov 30, 2021
1 parent a9c743e commit 61e898b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/net/ixgbe/ixgbe_ethdev.c
Expand Up @@ -1439,6 +1439,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;
Expand Down Expand Up @@ -1475,6 +1476,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;
Expand Down

0 comments on commit 61e898b

Please sign in to comment.