net/mlx5: Add esw assignment back in mlx5e_tc_sample_unoffload()
Subsystems (4)
PATCH 1/1 net/mlx5: Add esw assignment back in mlx5e_tc_sample_unoffload()
Clang warns:
drivers/net/ethernet/mellanox/mlx5/core/en/tc/sample.c:635:34: error: variable 'esw' is uninitialized when used here [-Werror,-Wuninitialized]
mlx5_eswitch_del_offloaded_rule(esw, sample_flow->pre_rule, sample_flow->pre_attr);
^~~
drivers/net/ethernet/mellanox/mlx5/core/en/tc/sample.c:626:26: note: initialize the variable 'esw' to silence this warning
struct mlx5_eswitch *esw;
^
= NULL1 error generated.
It appears that the assignment should have been shuffled instead of removed outright like in mlx5e_tc_sample_offload(). Add it back so there is no use of esw uninitialized.
--- drivers/net/ethernet/mellanox/mlx5/core/en/tc/sample.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/ethernet/mellanox/mlx5/core/en/tc/sample.c +1 -0
@@ -631,6 +631,7 @@ mlx5e_tc_sample_unoffload(struct mlx5e_tc_psample *tc_psample,/* The following delete order can't be changed, otherwise, * will hit fw syndromes. */ + esw = tc_psample->esw; sample_flow = attr->sample_attr->sample_flow;mlx5_eswitch_del_offloaded_rule (esw, sample_flow->pre_rule, sample_flow->pre_attr);
base-commit: 6487c819393ed1678ef847fd260ea86edccc0bb3
Signature · 1 line
2.33.1.637.gf443b226ca
Quoted 20 lines · Nathan Chancellor
Clang warns:
drivers/net/ethernet/mellanox/mlx5/core/en/tc/sample.c:635:34: error:
variable 'esw' is uninitialized when used here [-Werror,- Wuninitialized]
mlx5_eswitch_del_offloaded_rule(esw, sample_flow->pre_rule, sample_flow->pre_attr);
^~~drivers/net/ethernet/mellanox/mlx5/core/en/tc/sample.c:626:26: note:
initialize the variable 'esw' to silence this warning structmlx5_eswitch*esw;
^
= NULL
1 error generated.It appears that the assignment should have been shuffled instead of removed outright like in
mlx5e_tc_sample_offload(). Add it back so there
is no use of esw uninitialized.
Quoted 4 lines
Fixes a64c5edbd20e ("net/mlx5: Remove unnecessary checks for slowpath flag")
Nice catch !
applied to net-next-mlx5,
Thanks !