Commit c7c35916 authored by Prasad J Pandit's avatar Prasad J Pandit Committed by Jason Wang
Browse files

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: default avatarAndrew Henderson <hendersa@icculus.org>
Signed-off-by: default avatarPrasad J Pandit <pjp@fedoraproject.org>
Signed-off-by: default avatarJason Wang <jasowang@redhat.com>
parent fdda170e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;
    }