]> git.baikalelectronics.ru Git - kernel.git/commit
net/mlx5e: TC, Hold sample_attr on stack instead of pointer
authorRoi Dayan <roid@nvidia.com>
Sun, 5 Dec 2021 13:10:35 +0000 (15:10 +0200)
committerSaeed Mahameed <saeedm@nvidia.com>
Thu, 27 Jan 2022 20:37:33 +0000 (12:37 -0800)
commit0ee5482695a68e08f1571e26e1adf1945818b73a
tree65f7ed875f0b20356d9b287cf83cf916836f8362
parent98bff6c729a8c2e472601fc7b7fb18bf70e0dbfb
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>
drivers/net/ethernet/mellanox/mlx5/core/en/tc/act/sample.c
drivers/net/ethernet/mellanox/mlx5/core/en/tc/sample.c
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
drivers/net/ethernet/mellanox/mlx5/core/en_tc.h
drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c