summaryrefslogtreecommitdiff
path: root/net/mac802154/tx.c
diff options
context:
space:
mode:
authorAlexander Aring <aahringo@redhat.com>2022-06-13 07:37:35 +0300
committerStefan Schmidt <stefan@datenfreihafen.org>2022-06-14 11:23:51 +0300
commit6c1c78d0182fcbfe953bf5a0c3e71204d176b887 (patch)
tree97a6041ccc438ea3df2c33d2e869e60ee6d6b2c5 /net/mac802154/tx.c
parent2ec2f6bed4d12a7ed74ed179a5d2879b117105d1 (diff)
downloadlinux-6c1c78d0182fcbfe953bf5a0c3e71204d176b887.tar.xz
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/tx.c')
-rw-r--r--net/mac802154/tx.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/mac802154/tx.c b/net/mac802154/tx.c
index 5b471e932271..8ddcd2e841ca 100644
--- a/net/mac802154/tx.c
+++ b/net/mac802154/tx.c
@@ -44,7 +44,7 @@ void ieee802154_xmit_sync_worker(struct work_struct *work)
err_tx:
/* Restart the netif queue on each sub_if_data object. */
ieee802154_release_queue(local);
- if (!atomic_dec_and_test(&local->phy->ongoing_txs))
+ if (atomic_dec_and_test(&local->phy->ongoing_txs))
wake_up(&local->phy->sync_txq);
kfree_skb(skb);
netdev_dbg(dev, "transmission failed\n");
@@ -101,7 +101,7 @@ ieee802154_tx(struct ieee802154_local *local, struct sk_buff *skb)
err_wake_netif_queue:
ieee802154_release_queue(local);
- if (!atomic_dec_and_test(&local->phy->ongoing_txs))
+ if (atomic_dec_and_test(&local->phy->ongoing_txs))
wake_up(&local->phy->sync_txq);
err_free_skb:
kfree_skb(skb);