carl9170 firmware: double check if unlinked desc matches head desc
authorChristian Lamparter <chunkeey@googlemail.com>
Fri, 23 Dec 2011 19:35:18 +0000 (20:35 +0100)
committerChristian Lamparter <chunkeey@googlemail.com>
Fri, 23 Dec 2011 19:35:18 +0000 (20:35 +0100)
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
carlfw/src/wlan.c

index bae584f02123e8da948428f0ade04733d8c5ea29..a7c805b588908267541bd994f6c878a0abea16c2 100644 (file)
@@ -408,7 +408,11 @@ static bool wlan_tx_status(struct dma_queue *queue,
                                 * be aware of this so the frames don't get lost.
                                 */
 
+#ifndef CONFIG_CARL9170FW_DEBUG
                                dma_unlink_head(queue);
+#else /* CONFIG_CARL9170FW_DEBUG */
+                               BUG_ON(dma_unlink_head(queue) != desc);
+#endif /* CONFIG_CARL9170FW_DEBUG */
                                dma_put(&fw.wlan.tx_retry, desc);
                                return true;
                        }
@@ -418,7 +422,11 @@ static bool wlan_tx_status(struct dma_queue *queue,
                }
        }
 
+#ifndef CONFIG_CARL9170FW_DEBUG
        dma_unlink_head(queue);
+#else /* CONFIG_CARL9170FW_DEBUG */
+       BUG_ON(dma_unlink_head(queue) != desc);
+#endif /* CONFIG_CARL9170FW_DEBUG */
        if (txfail) {
                /*
                 * Issue the queue bump,