Skip to content

Commit

Permalink
net: rtl8139: limit processing of ring descriptors
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Prasad J Pandit authored and jasowang committed Oct 26, 2016
1 parent fdda170 commit c7c3591
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion hw/net/rtl8139.c
Expand Up @@ -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;
}
Expand Down

0 comments on commit c7c3591

Please sign in to comment.