summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/mellanox/mlx5/core/en_tc.h
diff options
context:
space:
mode:
authorRoi Dayan <roid@nvidia.com>2021-12-05 16:10:35 +0300
committerSaeed Mahameed <saeedm@nvidia.com>2022-01-27 23:37:33 +0300
commiteeed226ed110ed40598e60e29b66643012277be7 (patch)
tree65f7ed875f0b20356d9b287cf83cf916836f8362 /drivers/net/ethernet/mellanox/mlx5/core/en_tc.h
parent3b49a7edec1df4f7019b3b872124231197267205 (diff)
downloadlinux-eeed226ed110ed40598e60e29b66643012277be7.tar.xz
net/mlx5e: TC, Hold sample_attr on stack instead of pointer
In later commit we are going to instantiate multiple attr instances for flow instead of single attr. Parsing TC sample allocates a new memory but there is no symmetric cleanup in the infrastructure. To avoid asymmetric alloc/free use sample_attr as part of the flow attr and not allocated and held as a pointer. This will avoid a cleanup leak when sample action is not on the first attr. Signed-off-by: Roi Dayan <roid@nvidia.com> Reviewed-by: Oz Shlomo <ozsh@nvidia.com> Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx5/core/en_tc.h')
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/en_tc.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.h b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.h
index 0da5ea44f607..c68730250fb3 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.h
@@ -71,7 +71,7 @@ struct mlx5_flow_attr {
struct mlx5_fc *counter;
struct mlx5_modify_hdr *modify_hdr;
struct mlx5_ct_attr ct_attr;
- struct mlx5e_sample_attr *sample_attr;
+ struct mlx5e_sample_attr sample_attr;
struct mlx5e_tc_flow_parse_attr *parse_attr;
u32 chain;
u16 prio;