summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoi Dayan <roid@nvidia.com>2021-01-12 13:04:29 +0100
committerSaeed Mahameed <saeedm@nvidia.com>2021-01-27 00:38:36 +0100
commit487c6ef81eb98d0a43cb08be91b1fcc9b4250626 (patch)
treea242e195832bd92f83b6373e91bdb765178fb9ff
parentMerge tag 'mac80211-for-net-2021-01-26' of git://git.kernel.org/pub/scm/linux... (diff)
downloadlinux-487c6ef81eb98d0a43cb08be91b1fcc9b4250626.tar.xz
linux-487c6ef81eb98d0a43cb08be91b1fcc9b4250626.zip
net/mlx5: Fix memory leak on flow table creation error flow
When we create the ft object we also init rhltable in ft->fgs_hash. So in error flow before kfree of ft we need to destroy that rhltable. Fixes: 693c6883bbc4 ("net/mlx5: Add hash table for flow groups in flow table") Signed-off-by: Roi Dayan <roid@nvidia.com> Reviewed-by: Maor Dickman <maord@nvidia.com> Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/fs_core.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
index b899539a0786..0fcee702b808 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
@@ -1141,6 +1141,7 @@ static struct mlx5_flow_table *__mlx5_create_flow_table(struct mlx5_flow_namespa
destroy_ft:
root->cmds->destroy_flow_table(root, ft);
free_ft:
+ rhltable_destroy(&ft->fgs_hash);
kfree(ft);
unlock_root:
mutex_unlock(&root->chain_lock);