summaryrefslogtreecommitdiffstats
path: root/hw
diff options
context:
space:
mode:
authorPrasad J Pandit2016-10-21 14:09:29 +0200
committerJason Wang2016-10-26 03:57:59 +0200
commitc7c35916692fe010fef25ac338443d3fe40be225 (patch)
treedf4478904ee489bdd6def25355eba75848d5aef0 /hw
parentnet: vmxnet: initialise local tx descriptor (diff)
downloadqemu-c7c35916692fe010fef25ac338443d3fe40be225.tar.gz
qemu-c7c35916692fe010fef25ac338443d3fe40be225.tar.xz
qemu-c7c35916692fe010fef25ac338443d3fe40be225.zip
net: rtl8139: limit processing of ring descriptors
RTL8139 ethernet controller in C+ mode supports multiple descriptor rings, each with maximum of 64 descriptors. While processing transmit descriptor ring in 'rtl8139_cplus_transmit', it does not limit the descriptor count and runs forever. Add check to avoid it. Reported-by: Andrew Henderson <hendersa@icculus.org> Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org> Signed-off-by: Jason Wang <jasowang@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/net/rtl8139.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/net/rtl8139.c b/hw/net/rtl8139.c
index 3345bc6b5e..f05e59c85f 100644
--- a/hw/net/rtl8139.c
+++ b/hw/net/rtl8139.c
@@ -2350,7 +2350,7 @@ static void rtl8139_cplus_transmit(RTL8139State *s)
{
int txcount = 0;
- while (rtl8139_cplus_transmit_one(s))
+ while (txcount < 64 && rtl8139_cplus_transmit_one(s))
{
++txcount;
}