net: bgmac: Fix infinite loop in bgmac_dma_tx_add()
[firefly-linux-kernel-4.4.55.git] / drivers / net / ethernet / broadcom / bgmac.c
index 28f7610b03febf79e11056308f3a4e3695274bf6..c32f5d32f81187d5ca4e6baba780f8eca142d632 100644 (file)
@@ -219,7 +219,7 @@ err_dma:
        dma_unmap_single(dma_dev, slot->dma_addr, skb_headlen(skb),
                         DMA_TO_DEVICE);
 
-       while (i > 0) {
+       while (i-- > 0) {
                int index = (ring->end + i) % BGMAC_TX_RING_SLOTS;
                struct bgmac_slot_info *slot = &ring->slots[index];
                u32 ctl1 = le32_to_cpu(ring->cpu_base[index].ctl1);