summaryrefslogtreecommitdiff
path: root/drivers/net
diff options
context:
space:
mode:
authorMichael Buesch <mb@bu3sch.de>2009-02-19 19:17:36 (GMT)
committerJohn W. Linville <linville@tuxdriver.com>2009-02-27 19:52:47 (GMT)
commitca2d559e1a41d62a5b49fb9ab513025ea27f1e7c (patch)
tree3123aa59d4323b1cd0861946761377e91ffe86e5 /drivers/net
parentdbaaa147d6396c41d8f31156a777dfdaae2335a4 (diff)
downloadlinux-ca2d559e1a41d62a5b49fb9ab513025ea27f1e7c.tar.xz
b43: Move DMA stop sanity check
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>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/b43/dma.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/net/wireless/b43/dma.c b/drivers/net/wireless/b43/dma.c
index 6d65a02..0f021c6 100644
--- a/drivers/net/wireless/b43/dma.c
+++ b/drivers/net/wireless/b43/dma.c
@@ -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