Skip to content

Commit

Permalink
b43: Move DMA stop sanity check
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Michael Buesch authored and John W. Linville committed Feb 27, 2009
1 parent dbaaa14 commit ca2d559
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions drivers/net/wireless/b43/dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ca2d559

Please sign in to comment.