Re: [PATCH v6 2/2] net/mlx5: Move ttc allocation after switch case to prevent leaks

From: Jakub Kicinski
Date: Thu Apr 17 2025 - 11:04:40 EST


On Wed, 16 Apr 2025 15:02:13 +0300 Mark Bloch wrote:
> On 16/04/2025 12:22, Henry Martin wrote:
> > 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.
>
> Reviewed-by: Mark Bloch <mbloch@xxxxxxxxxx>

A bit hard to see from the context but I'm guessing this fixes
a memory leak? We need a Fixes tag..

reminder: please trim your replies
--
pw-bot: cr