[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 8/9] net: rtl8139: limit processing of ring descripto
From: |
Jason Wang |
Subject: |
[Qemu-devel] [PULL 8/9] net: rtl8139: limit processing of ring descriptors |
Date: |
Wed, 26 Oct 2016 10:24:10 +0800 |
From: Prasad J Pandit <address@hidden>
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 <address@hidden>
Signed-off-by: Prasad J Pandit <address@hidden>
Signed-off-by: Jason Wang <address@hidden>
---
hw/net/rtl8139.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/net/rtl8139.c b/hw/net/rtl8139.c
index 3345bc6..f05e59c 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;
}
--
2.7.4
- [Qemu-devel] [PULL 0/9] Net patches, Jason Wang, 2016/10/25
- [Qemu-devel] [PULL 1/9] net: pcnet: check rx/tx descriptor ring length, Jason Wang, 2016/10/25
- [Qemu-devel] [PULL 2/9] net: pcnet: fix source formatting and indentation, Jason Wang, 2016/10/25
- [Qemu-devel] [PULL 3/9] tap-bsd: OpenBSD uses tap(4) now, Jason Wang, 2016/10/25
- [Qemu-devel] [PULL 4/9] net: eepro100: fix memory leak in device uninit, Jason Wang, 2016/10/25
- [Qemu-devel] [PULL 5/9] net: rocker: set limit to DMA buffer size, Jason Wang, 2016/10/25
- [Qemu-devel] [PULL 6/9] e1000e: Don't zero out buffer address in rx descriptor, Jason Wang, 2016/10/25
- [Qemu-devel] [PULL 7/9] net: vmxnet: initialise local tx descriptor, Jason Wang, 2016/10/25
- [Qemu-devel] [PULL 8/9] net: rtl8139: limit processing of ring descriptors,
Jason Wang <=
- [Qemu-devel] [PULL 9/9] colo-proxy: fix memory leak, Jason Wang, 2016/10/25
Re: [Qemu-devel] [PULL 0/9] Net patches, Peter Maydell, 2016/10/27