diff options
author | 2022-06-13 00:37:35 -0400 | |
---|---|---|
committer | 2022-06-14 10:23:51 +0200 | |
commit | 6c1c78d0182fcbfe953bf5a0c3e71204d176b887 (patch) | |
tree | 97a6041ccc438ea3df2c33d2e869e60ee6d6b2c5 /net/mac802154/util.c | |
parent | mac802154: util: fix release queue handling (diff) | |
download | linux-6c1c78d0182fcbfe953bf5a0c3e71204d176b887.tar.gz linux-6c1c78d0182fcbfe953bf5a0c3e71204d176b887.tar.bz2 linux-6c1c78d0182fcbfe953bf5a0c3e71204d176b887.zip |
mac802154: fix atomic_dec_and_test checks
We need to call wake_up() when hold_txs reaches zero. The semantic of
atomic_dec_and_test() is that it returns true when it's zero.
Fixes: f0feb3490473 ("net: mac802154: Introduce a tx queue flushing mechanism")
Signed-off-by: Alexander Aring <aahringo@redhat.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/r/20220613043735.1039895-3-aahringo@redhat.com
Signed-off-by: Stefan Schmidt <stefan@datenfreihafen.org>
Diffstat (limited to 'net/mac802154/util.c')
-rw-r--r-- | net/mac802154/util.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/mac802154/util.c b/net/mac802154/util.c index 60f6c0f10641..f08605f59b60 100644 --- a/net/mac802154/util.c +++ b/net/mac802154/util.c @@ -141,7 +141,7 @@ void ieee802154_xmit_complete(struct ieee802154_hw *hw, struct sk_buff *skb, } dev_consume_skb_any(skb); - if (!atomic_dec_and_test(&hw->phy->ongoing_txs)) + if (atomic_dec_and_test(&hw->phy->ongoing_txs)) wake_up(&hw->phy->sync_txq); } EXPORT_SYMBOL(ieee802154_xmit_complete); @@ -154,7 +154,7 @@ void ieee802154_xmit_error(struct ieee802154_hw *hw, struct sk_buff *skb, local->tx_result = reason; ieee802154_release_queue(local); dev_kfree_skb_any(skb); - if (!atomic_dec_and_test(&hw->phy->ongoing_txs)) + if (atomic_dec_and_test(&hw->phy->ongoing_txs)) wake_up(&hw->phy->sync_txq); } EXPORT_SYMBOL(ieee802154_xmit_error); |