net/mlx5: HWS, Fix uninitialized variables in mlx5hws_pat_calc_nop error flow
authorLama Kayal <lkayal@nvidia.com>
Mon, 25 Aug 2025 14:34:26 +0000 (17:34 +0300)
committerJakub Kicinski <kuba@kernel.org>
Wed, 27 Aug 2025 01:00:26 +0000 (18:00 -0700)
commit24b6e53140475b56cadcccd4e82a93aa5bacf1eb
tree0dedfcd31f7ae4419aa495da0e95da55b9d1fe6b
parenta630f83592cdad1253523a1b760cfe78fef6cd9c
net/mlx5: HWS, Fix uninitialized variables in mlx5hws_pat_calc_nop error flow

In mlx5hws_pat_calc_nop(), src_field and dst_field are passed to
hws_action_modify_get_target_fields() which should set their values.
However, if an invalid action type is encountered, these variables
remain uninitialized and are later used to update prev_src_field
and prev_dst_field.

Initialize both variables to INVALID_FIELD to ensure they have
defined values in all code paths.

Fixes: 01e035fd0380 ("net/mlx5: HWS, handle modify header actions dependency")
Signed-off-by: Lama Kayal <lkayal@nvidia.com>
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Signed-off-by: Mark Bloch <mbloch@nvidia.com>
Link: https://patch.msgid.link/20250825143435.598584-4-mbloch@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/steering/hws/pat_arg.c