Commit 108948f7 authored by Zilin Guan's avatar Zilin Guan Committed by Jakub Kicinski
Browse files

net/mlx5: Fix memory leak in esw_acl_ingress_lgcy_setup()



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: 07bab950 ("net/mlx5: E-Switch, Refactor eswitch ingress acl codes")
Signed-off-by: default avatarZilin Guan <zilin@seu.edu.cn>
Reviewed-by: default avatarTariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/20260120134640.2717808-1-zilin@seu.edu.cn


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 0a80e38d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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);