[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6a055080-e4f1-4a1d-98ba-dca81a26b3a0@gmail.com>
Date: Thu, 22 Jan 2026 12:27:08 +0200
From: Tariq Toukan <ttoukan.linux@...il.com>
To: Zilin Guan <zilin@....edu.cn>, saeedm@...dia.com
Cc: leon@...nel.org, tariqt@...dia.com, mbloch@...dia.com,
andrew+netdev@...n.ch, davem@...emloft.net, edumazet@...gle.com,
kuba@...nel.org, pabeni@...hat.com, netdev@...r.kernel.org,
linux-rdma@...r.kernel.org, linux-kernel@...r.kernel.org,
jianhao.xu@....edu.cn
Subject: Re: [PATCH net] net/mlx5: Fix memory leak in
esw_acl_ingress_lgcy_setup()
On 20/01/2026 15:46, Zilin Guan wrote:
> In esw_acl_ingress_lgcy_setup(), if esw_acl_table_create() fails,
> the function returns directly without releasing the previously
> created counter, leading to a memory leak.
>
> Fix this by jumping to the out label instead of returning directly,
> which aligns with the error handling logic of other paths in this
> function.
>
> Compile tested only. Issue found using a prototype static analysis tool
> and code review.
>
> Fixes: 07bab9502641 ("net/mlx5: E-Switch, Refactor eswitch ingress acl codes")
> Signed-off-by: Zilin Guan <zilin@....edu.cn>
> ---
> drivers/net/ethernet/mellanox/mlx5/core/esw/acl/ingress_lgcy.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/esw/acl/ingress_lgcy.c b/drivers/net/ethernet/mellanox/mlx5/core/esw/acl/ingress_lgcy.c
> index 1c37098e09ea..49a637829c59 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/esw/acl/ingress_lgcy.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/esw/acl/ingress_lgcy.c
> @@ -188,7 +188,7 @@ int esw_acl_ingress_lgcy_setup(struct mlx5_eswitch *esw,
> if (IS_ERR(vport->ingress.acl)) {
> err = PTR_ERR(vport->ingress.acl);
> vport->ingress.acl = NULL;
> - return err;
> + goto out;
> }
>
> err = esw_acl_ingress_lgcy_groups_create(esw, vport);
Reviewed-by: Tariq Toukan <tariqt@...dia.com>
Thanks for your patch.
Tariq
Powered by blists - more mailing lists