cxgb4: smt: Add lock for atomic_dec_and_test
authorChuhong Yuan <hslester96@gmail.com>
Tue, 6 Aug 2019 02:58:46 +0000 (10:58 +0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 9 Aug 2019 01:12:17 +0000 (18:12 -0700)
commit4a8937b83892cb69524291cae6cdabad4a8be033
treeb5a9309221ad0f066bdd08f1539a7fc2ecacd19b
parente858ef1cd4bc1bdfcd18114a8195236e336cee42
cxgb4: smt: Add lock for atomic_dec_and_test

The atomic_dec_and_test() is not safe because it is
outside of locks.
Move the locks of t4_smte_free() to its caller,
cxgb4_smt_release() to protect the atomic decrement.

Fixes: 3bdb376e6944 ("cxgb4: introduce SMT ops to prepare for SMAC rewrite support")
Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/chelsio/cxgb4/smt.c