mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 02:21:52 +09:00
net: bgmac: Fix infinite loop in bgmac_dma_tx_add()
[ Upstream commite86663c475] Nothing is decrementing the index "i" while we are cleaning up the fragments we could not successful transmit. Fixes:9cde94506e("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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
0020fa536c
commit
863c8bb8be
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user