6e0c7a
From: Prasad J Pandit <address@hidden>
6e0c7a
6e0c7a
RTL8139 ethernet controller in C+ mode supports multiple
6e0c7a
descriptor rings, each with maximum of 64 descriptors. While
6e0c7a
processing transmit descriptor ring in 'rtl8139_cplus_transmit',
6e0c7a
it does not limit the descriptor count and runs forever. Add
6e0c7a
check to avoid it.
6e0c7a
6e0c7a
Reported-by: Andrew Henderson <address@hidden>
6e0c7a
Signed-off-by: Prasad J Pandit <address@hidden>
6e0c7a
---
6e0c7a
 hw/net/rtl8139.c | 2 +-
6e0c7a
 1 file changed, 1 insertion(+), 1 deletion(-)
6e0c7a
6e0c7a
diff --git a/hw/rtl8139.c b/hw/rtl8139.c
6e0c7a
index 3345bc6..f05e59c 100644
6e0c7a
--- a/hw/rtl8139.c
6e0c7a
+++ b/hw/rtl8139.c
6e0c7a
@@ -2350,7 +2350,7 @@ static void rtl8139_cplus_transmit(RTL8139State *s)
6e0c7a
 {
6e0c7a
     int txcount = 0;
6e0c7a
 
6e0c7a
-    while (rtl8139_cplus_transmit_one(s))
6e0c7a
+    while (txcount < 64 && rtl8139_cplus_transmit_one(s))
6e0c7a
     {
6e0c7a
         ++txcount;
6e0c7a
     }
6e0c7a
-- 
6e0c7a
2.7.4