b43: Move DMA stop sanity check
authorMichael Buesch <mb@bu3sch.de>
Thu, 19 Feb 2009 19:17:36 +0000 (20:17 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 27 Feb 2009 19:52:47 +0000 (14:52 -0500)
Move the DMA stop sanity check up a few lines, so it's actually
theoretically possible to trigger. (But it still shouldn't trigger, of course).

Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/b43/dma.c

index 6d65a02b7052cdfa0d754a029038dcb66d96c788..0f021c666d08b517d52fd8e7bfdb43b8d02dd9db 100644 (file)
@@ -1306,16 +1306,18 @@ int b43_dma_tx(struct b43_wldev *dev, struct sk_buff *skb)
        }
 
        spin_lock_irqsave(&ring->lock, flags);
+
        B43_WARN_ON(!ring->tx);
+       /* Check if the queue was stopped in mac80211,
+        * but we got called nevertheless.
+        * That would be a mac80211 bug. */
+       B43_WARN_ON(ring->stopped);
+
        if (unlikely(free_slots(ring) < SLOTS_PER_PACKET)) {
                b43warn(dev->wl, "DMA queue overflow\n");
                err = -ENOSPC;
                goto out_unlock;
        }
-       /* Check if the queue was stopped in mac80211,
-        * but we got called nevertheless.
-        * That would be a mac80211 bug. */
-       B43_WARN_ON(ring->stopped);
 
        /* Assign the queue number to the ring (if not already done before)
         * so TX status handling can use it. The queue to ring mapping is