* [PATCH net] net: bgmac: Fix infinite loop in bgmac_dma_tx_add()
@ 2016-07-15 22:42 Florian Fainelli
2016-07-15 23:04 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Florian Fainelli @ 2016-07-15 22:42 UTC (permalink / raw)
To: netdev
Cc: davem, zajec5, hauke, jon.mason, bcm-kernel-feedback-list, nbd,
Florian Fainelli
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>
---
drivers/net/ethernet/broadcom/bgmac.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/broadcom/bgmac.c b/drivers/net/ethernet/broadcom/bgmac.c
index a6333d38ecc0..25bbae5928d4 100644
--- a/drivers/net/ethernet/broadcom/bgmac.c
+++ b/drivers/net/ethernet/broadcom/bgmac.c
@@ -231,7 +231,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);
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net] net: bgmac: Fix infinite loop in bgmac_dma_tx_add()
2016-07-15 22:42 [PATCH net] net: bgmac: Fix infinite loop in bgmac_dma_tx_add() Florian Fainelli
@ 2016-07-15 23:04 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2016-07-15 23:04 UTC (permalink / raw)
To: f.fainelli
Cc: netdev, zajec5, hauke, jon.mason, bcm-kernel-feedback-list, nbd
From: Florian Fainelli <f.fainelli@gmail.com>
Date: Fri, 15 Jul 2016 15:42:52 -0700
> 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>
Applied and queued up for -stable, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-07-15 23:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-15 22:42 [PATCH net] net: bgmac: Fix infinite loop in bgmac_dma_tx_add() Florian Fainelli
2016-07-15 23:04 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).