mirror of
https://github.com/torvalds/linux.git
synced 2026-10-07 05:31:08 -04:00
mlxsw: spectrum_span: On policer_id_base_ref_count, use dec_and_test
When unsetting policer base, the SPAN code currently uses refcount_dec(). However that function splats when the counter reaches zero, because reaching zero without actually testing is in general indicative of a missing cleanup. There is no cleanup to be done here, but nonetheless, use refcount_dec_and_test() as required. Signed-off-by: Petr Machata <[email protected]> Reviewed-by: Jiri Pirko <[email protected]> Signed-off-by: Ido Schimmel <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
1 parent
76ba292cc7
commit
928345c08b
1 file changed
+2
-1
@@ -837,7 +837,8 @@ static int mlxsw_sp_span_policer_id_base_set(struct mlxsw_sp_span *span,
|
||||
|
||||
static void mlxsw_sp_span_policer_id_base_unset(struct mlxsw_sp_span *span)
|
||||
{
|
||||
refcount_dec(&span->policer_id_base_ref_count);
|
||||
if (refcount_dec_and_test(&span->policer_id_base_ref_count))
|
||||
span->policer_id_base = 0;
|
||||
}
|
||||
|
||||
static struct mlxsw_sp_span_entry *
|
||||
|
||||
Reference in new issue
Block a user