mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-09 14:50:19 +00:00
net: bgmac: Fix infinite loop in bgmac_dma_tx_add()
Nothing is decrementing the index "i" while we are cleaning up the fragments we could not successful transmit. Fixes: 9cde94506eacf ("bgmac: implement scatter/gather support") Reported-by: coverity (CID 1352048) Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
f57ec1889f
commit
e86663c475
@ -231,7 +231,7 @@ err_dma:
|
|||||||
dma_unmap_single(dma_dev, slot->dma_addr, skb_headlen(skb),
|
dma_unmap_single(dma_dev, slot->dma_addr, skb_headlen(skb),
|
||||||
DMA_TO_DEVICE);
|
DMA_TO_DEVICE);
|
||||||
|
|
||||||
while (i > 0) {
|
while (i-- > 0) {
|
||||||
int index = (ring->end + i) % BGMAC_TX_RING_SLOTS;
|
int index = (ring->end + i) % BGMAC_TX_RING_SLOTS;
|
||||||
struct bgmac_slot_info *slot = &ring->slots[index];
|
struct bgmac_slot_info *slot = &ring->slots[index];
|
||||||
u32 ctl1 = le32_to_cpu(ring->cpu_base[index].ctl1);
|
u32 ctl1 = le32_to_cpu(ring->cpu_base[index].ctl1);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user