Skip to content

Commit

Permalink
net/mlx5: HWS, fixed double free in error flow of definer layout
Browse files Browse the repository at this point in the history
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 <kliteyn@nvidia.com>
Reviewed-by: Itamar Gozlan <igozlan@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
  • Loading branch information
Yevgeny Kliteynik authored and Paolo Abeni committed Oct 17, 2024
1 parent 65b4eb9 commit 5aa2184
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1925,7 +1925,7 @@ mlx5hws_definer_calc_layout(struct mlx5hws_context *ctx,
ret = hws_definer_conv_match_params_to_hl(ctx, mt, match_hl);
if (ret) {
mlx5hws_err(ctx, "Failed to convert items to header layout\n");
goto free_fc;
goto free_match_hl;
}

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

free_fc:
kfree(mt->fc);

free_match_hl:
kfree(match_hl);
return ret;
}
Expand Down

0 comments on commit 5aa2184

Please sign in to comment.