Commit fa8fd315 authored by Henry Martin's avatar Henry Martin Committed by Jakub Kicinski
Browse files

net/mlx5: Move ttc allocation after switch case to prevent leaks



Relocate the memory allocation for ttc table after the switch statement
that validates params->ns_type in both mlx5_create_inner_ttc_table() and
mlx5_create_ttc_table(). This ensures memory is only allocated after
confirming valid input, eliminating potential memory leaks when invalid
ns_type cases occur.

Fixes: 137f3d50 ("net/mlx5: Support matching on l4_type for ttc_table")
Signed-off-by: default avatarHenry Martin <bsdhenrymartin@gmail.com>
Reviewed-by: default avatarMichal Swiatkowski <michal.swiatkowski@linux.intel.com>
Reviewed-by: default avatarMark Bloch <mbloch@nvidia.com>
Link: https://patch.msgid.link/20250418023814.71789-3-bsdhenrymartin@gmail.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 91037037
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment