]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
mlxsw: spectrum_acl_tcam: Make fini symmetric to init
authorIdo Schimmel <idosch@nvidia.com>
Mon, 6 Feb 2023 15:39:20 +0000 (16:39 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Jan 2024 22:52:55 +0000 (14:52 -0800)
[ Upstream commit 61fe3b9102ac84ba479ab84d8f5454af2e21e468 ]

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

Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Stable-dep-of: 483ae90d8f97 ("mlxsw: spectrum_acl_tcam: Fix stack corruption")
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c

index c8d9f523242ee71b694c5f666b01ea2682c404c8..08d91bfa7b39bfcbfbae6fd50015e4785e569f82 100644 (file)
@@ -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,