Skip to content

Commit 5aa2184

Browse files
kliteynPaolo Abeni
authored andcommitted
net/mlx5: HWS, fixed double free in error flow of definer layout
Fix error flow bug that could lead to double free of a buffer during a failure to calculate a suitable definer layout. Fixes: 74a778b ("net/mlx5: HWS, added definers handling") Signed-off-by: Yevgeny Kliteynik <[email protected]> Reviewed-by: Itamar Gozlan <[email protected]> Signed-off-by: Tariq Toukan <[email protected]> Signed-off-by: Paolo Abeni <[email protected]>
1 parent 65b4eb9 commit 5aa2184

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_definer.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1925,7 +1925,7 @@ mlx5hws_definer_calc_layout(struct mlx5hws_context *ctx,
19251925
ret = hws_definer_conv_match_params_to_hl(ctx, mt, match_hl);
19261926
if (ret) {
19271927
mlx5hws_err(ctx, "Failed to convert items to header layout\n");
1928-
goto free_fc;
1928+
goto free_match_hl;
19291929
}
19301930

19311931
/* Find the match definer layout for header layout match union */
@@ -1946,7 +1946,7 @@ mlx5hws_definer_calc_layout(struct mlx5hws_context *ctx,
19461946

19471947
free_fc:
19481948
kfree(mt->fc);
1949-
1949+
free_match_hl:
19501950
kfree(match_hl);
19511951
return ret;
19521952
}

0 commit comments

Comments
 (0)