Commit c76519e1 authored by Ido Schimmel's avatar Ido Schimmel Committed by Liu Jian
Browse files

mlxsw: spectrum_acl_tcam: Make fini symmetric to init

stable inclusion
from stable-v5.10.209
commit d3669ebc4c2a7ede3d9901ba5bee8b806eea98de
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/I932WD
CVE: CVE-2024-26586

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=d3669ebc4c2a7ede3d9901ba5bee8b806eea98de



---------------------------

[ Upstream commit 61fe3b91 ]

Move mutex_destroy() to the end to make the function symmetric with
mlxsw_sp_acl_tcam_init(). No functional changes.

Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
Reviewed-by: default avatarJiri Pirko <jiri@nvidia.com>
Signed-off-by: default avatarPetr Machata <petrm@nvidia.com>
Reviewed-by: default avatarJacob Keller <jacob.e.keller@intel.com>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
Stable-dep-of: 483ae90d8f97 ("mlxsw: spectrum_acl_tcam: Fix stack corruption")
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarLiu Jian <liujian56@huawei.com>
parent 3d1f45c2
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -88,10 +88,10 @@ void mlxsw_sp_acl_tcam_fini(struct mlxsw_sp *mlxsw_sp,
{
	const struct mlxsw_sp_acl_tcam_ops *ops = mlxsw_sp->acl_tcam_ops;

	mutex_destroy(&tcam->lock);
	ops->fini(mlxsw_sp, tcam->priv);
	bitmap_free(tcam->used_groups);
	bitmap_free(tcam->used_regions);
	mutex_destroy(&tcam->lock);
}

int mlxsw_sp_acl_tcam_priority_get(struct mlxsw_sp *mlxsw_sp,