]> git.baikalelectronics.ru Git - kernel.git/commit
mlxsw: spectrum_acl: Fix mlxsw_sp_acl_tcam_group_add()'s error path
authorIdo Schimmel <idosch@nvidia.com>
Sun, 27 Sep 2020 06:42:11 +0000 (09:42 +0300)
committerDavid S. Miller <davem@davemloft.net>
Sun, 27 Sep 2020 20:22:31 +0000 (13:22 -0700)
commitb430fff0ebf95f3ac00d64f09c49c6c8d010922f
tree49b4a61be8b90182bfdb4d45122c5a94d4fde088
parentbd164b5ad8393457cc60ef32f6f1459e2511781c
mlxsw: spectrum_acl: Fix mlxsw_sp_acl_tcam_group_add()'s error path

If mlxsw_sp_acl_tcam_group_id_get() fails, the mutex initialized earlier
is not destroyed.

Fix this by initializing the mutex after calling the function. This is
symmetric to mlxsw_sp_acl_tcam_group_del().

Fixes: d30aa642cec7 ("mlxsw: spectrum_acl: Introduce a mutex to guard region list updates")
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c