Skip to content

Commit 1aec859

Browse files
nathanchanceSaeed Mahameed
authored andcommitted
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; ^ = 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. Fixes: a64c5ed ("net/mlx5: Remove unnecessary checks for slow path flag") Link: ClangBuiltLinux/linux#1494 Signed-off-by: Nathan Chancellor <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
1 parent 28131d8 commit 1aec859

File tree

1 file changed

+1
-0
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core/en/tc

1 file changed

+1
-0
lines changed

drivers/net/ethernet/mellanox/mlx5/core/en/tc/sample.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -631,6 +631,7 @@ mlx5e_tc_sample_unoffload(struct mlx5e_tc_psample *tc_psample,
631631
/* The following delete order can't be changed, otherwise,
632632
* will hit fw syndromes.
633633
*/
634+
esw = tc_psample->esw;
634635
sample_flow = attr->sample_attr->sample_flow;
635636
mlx5_eswitch_del_offloaded_rule(esw, sample_flow->pre_rule, sample_flow->pre_attr);
636637

0 commit comments

Comments
 (0)