]> git.baikalelectronics.ru Git - kernel.git/commit
mlxsw: spectrum_span: On policer_id_base_ref_count, use dec_and_test
authorPetr Machata <petrm@mellanox.com>
Mon, 3 Aug 2020 16:11:36 +0000 (19:11 +0300)
committerDavid S. Miller <davem@davemloft.net>
Tue, 4 Aug 2020 01:06:46 +0000 (18:06 -0700)
commite1d733ab9e6fb526c98f3114ffe35dd1e3e328f0
treea4843904560cd2a7224fea92fd9320b038aafdf5
parentbbfb250d5dd4ae7289c0bb7fda257c0ae70525bc
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 <petrm@mellanox.com>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c