diff options
author | Rafał Miłecki <rafal@milecki.pl> | 2016-08-17 12:54:49 +0200 |
---|---|---|
committer | Rafał Miłecki <rafal@milecki.pl> | 2016-08-17 12:55:25 +0200 |
commit | 7264df388616d2fa21d4cb97336e7e2afe3759ad (patch) | |
tree | 98eab999c4c44461608abdff14066200139e179e /target/linux/generic/patches-4.4/076-0003-net-bgmac-Fix-infinite-loop-in-bgmac_dma_tx_add.patch | |
parent | 93f2aa44f7833bd8d762ae4ef62c9f681ed58eef (diff) | |
download | master-31e0f0ae-7264df388616d2fa21d4cb97336e7e2afe3759ad.tar.gz master-31e0f0ae-7264df388616d2fa21d4cb97336e7e2afe3759ad.tar.bz2 master-31e0f0ae-7264df388616d2fa21d4cb97336e7e2afe3759ad.zip |
kernel: bgmac: backport 3 remaining small fixes
This makes bgmac in sync with upstream verison.
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Diffstat (limited to 'target/linux/generic/patches-4.4/076-0003-net-bgmac-Fix-infinite-loop-in-bgmac_dma_tx_add.patch')
-rw-r--r-- | target/linux/generic/patches-4.4/076-0003-net-bgmac-Fix-infinite-loop-in-bgmac_dma_tx_add.patch | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/target/linux/generic/patches-4.4/076-0003-net-bgmac-Fix-infinite-loop-in-bgmac_dma_tx_add.patch b/target/linux/generic/patches-4.4/076-0003-net-bgmac-Fix-infinite-loop-in-bgmac_dma_tx_add.patch new file mode 100644 index 0000000000..3834e64cd3 --- /dev/null +++ b/target/linux/generic/patches-4.4/076-0003-net-bgmac-Fix-infinite-loop-in-bgmac_dma_tx_add.patch @@ -0,0 +1,27 @@ +From e86663c475d384ab5f46cb5637e9b7ad08c5c505 Mon Sep 17 00:00:00 2001 +From: Florian Fainelli <f.fainelli@gmail.com> +Date: Fri, 15 Jul 2016 15:42:52 -0700 +Subject: [PATCH] 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> +--- + drivers/net/ethernet/broadcom/bgmac.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/net/ethernet/broadcom/bgmac.c ++++ b/drivers/net/ethernet/broadcom/bgmac.c +@@ -207,7 +207,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); |