mac802154: util: fix release queue handling
authorAlexander Aring <aahringo@redhat.com>
Mon, 13 Jun 2022 04:37:34 +0000 (00:37 -0400)
committerStefan Schmidt <stefan@datenfreihafen.org>
Tue, 14 Jun 2022 08:23:00 +0000 (10:23 +0200)
The semantic of atomic_dec_and_test() is to return true if zero is
reached and we need call ieee802154_wake_queue() when zero is reached.

Fixes: 20a19d1df3e4 ("net: mac802154: Bring the ability to hold the transmit queue")
Signed-off-by: Alexander Aring <aahringo@redhat.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/r/20220613043735.1039895-2-aahringo@redhat.com
Signed-off-by: Stefan Schmidt <stefan@datenfreihafen.org>
net/mac802154/util.c

index 60eb7bd3bfc14b4c6d606b7427318c51e290efd8..60f6c0f10641bb65ff5023a7922af9b94be349ad 100644 (file)
@@ -79,7 +79,7 @@ void ieee802154_release_queue(struct ieee802154_local *local)
        unsigned long flags;
 
        spin_lock_irqsave(&local->phy->queue_lock, flags);
-       if (!atomic_dec_and_test(&local->phy->hold_txs))
+       if (atomic_dec_and_test(&local->phy->hold_txs))
                ieee802154_wake_queue(&local->hw);
        spin_unlock_irqrestore(&local->phy->queue_lock, flags);
 }