diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index 204f4b2155ae0db3fbb67660a7bf92794ca0fdd0..fa29583937304a9f59487a5b62c68d3e8a925674 100644 --- a/drivers/net/usb/r8152.c +++ b/drivers/net/usb/r8152.c @@ -1813,6 +1813,10 @@ static int rx_bottom(struct r8152 *tp, int budget) unsigned int pkt_len; struct sk_buff *skb; + /* limite the skb numbers for rx_queue */ + if (unlikely(skb_queue_len(&tp->rx_queue) >= 1000)) + break; + pkt_len = le32_to_cpu(rx_desc->opts1) & RX_LEN_MASK; if (pkt_len < ETH_ZLEN) break;