Skip to contentSkip to conversation

Patch "net: bgmac: Fix infinite loop in bgmac_dma_tx_add()" has been added to the 4.4-stable tree

PATCH [email protected] 1 participant 1 message Aug 12, 2016

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

net: bgmac: Fix infinite loop in bgmac_dma_tx_add()

to the 4.4-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
net-bgmac-fix-infinite-loop-in-bgmac_dma_tx_add.patch
and it can be found in the queue-4.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From foo@baz Fri Aug 12 09:33:59 CEST 2016

From: Florian Fainelli <[email protected]>
Date: Fri, 15 Jul 2016 15:42:52 -0700
Subject: net: bgmac: Fix infinite loop in bgmac_dma_tx_add()

From: Florian Fainelli <[email protected]>

[ Upstream commit e86663c475d384ab5f46cb5637e9b7ad08c5c505 ]

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)
---
 drivers/net/ethernet/broadcom/bgmac.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/broadcom/bgmac.c +1 -1
@@ -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);

Patches currently in stable-queue which might be from [email protected] are

queue-4.4/net-bgmac-fix-infinite-loop-in-bgmac_dma_tx_add.patch