]> Git Repo - linux.git/commitdiff
net/mlx5: Fix memory leak on flow table creation error flow
authorRoi Dayan <[email protected]>
Tue, 12 Jan 2021 12:04:29 +0000 (14:04 +0200)
committerSaeed Mahameed <[email protected]>
Tue, 26 Jan 2021 23:38:36 +0000 (15:38 -0800)
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 <[email protected]>
Reviewed-by: Maor Dickman <[email protected]>
Signed-off-by: Saeed Mahameed <[email protected]>
drivers/net/ethernet/mellanox/mlx5/core/fs_core.c

index b899539a07860778fb8810843abbdc17df6ebcf9..0fcee702b808b020203e08174b2ceb3bd52a8b87 100644 (file)
@@ -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);
This page took 0.058216 seconds and 4 git commands to generate.