[2/8] net/mlx5/hws: fix memory leak in modify header free

Message ID 20240709123103.2101902-3-igozlan@nvidia.com (mailing list archive)
State Accepted, archived
Delegated to: Raslan Darawsheh
Headers
Series HW steering team updates |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Itamar Gozlan July 9, 2024, 12:30 p.m. UTC
From: Erez Shitrit <erezsh@nvidia.com>

When creating action from type MLX5DR_ACTION_TYP_REFORMAT_TNL_L3_TO_L2
we use modify-header object, we support few of that type at the same
time over this action depends on the number of headers.
Now when destroying the modify-header object we run over the
number_of_patterns, this variable was not set in the creation of that
action.

Fixes: 3a6c50215c07 ("net/mlx5/hws: support multi-pattern")
Cc: valex@nvidia.com
Cc: stable@dpdk.org

Signed-off-by: Erez Shitrit <erezsh@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
 drivers/net/mlx5/hws/mlx5dr_action.c | 1 +
 1 file changed, 1 insertion(+)
  

Patch

diff --git a/drivers/net/mlx5/hws/mlx5dr_action.c b/drivers/net/mlx5/hws/mlx5dr_action.c
index 03c3683f71..b90f18df8a 100644
--- a/drivers/net/mlx5/hws/mlx5dr_action.c
+++ b/drivers/net/mlx5/hws/mlx5dr_action.c
@@ -1820,6 +1820,7 @@  mlx5dr_action_handle_tunnel_l3_to_l2(struct mlx5dr_action *action,
 
 		action[i].modify_header.max_num_of_actions = num_of_actions;
 		action[i].modify_header.num_of_actions = num_of_actions;
+		action[i].modify_header.num_of_patterns = num_of_hdrs;
 		action[i].modify_header.arg_obj = arg_obj;
 		action[i].modify_header.pat_obj = pat_obj;
 		action[i].modify_header.require_reparse =