Message ID | 20250221174949.836197-10-mjt@tls.msk.ru (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | Patch Round-up for stable 9.2.2, freeze on 2025-02-23 | expand |
diff --git a/hw/net/smc91c111.c b/hw/net/smc91c111.c index 180ba5c791..2a652885c9 100644 --- a/hw/net/smc91c111.c +++ b/hw/net/smc91c111.c @@ -182,6 +182,15 @@ static void smc91c111_pop_rx_fifo(smc91c111_state *s) { int i; + if (s->rx_fifo_len == 0) { + /* + * The datasheet doesn't document what the behaviour is if the + * guest tries to pop an empty RX FIFO, and there's no obvious + * error status register to report it. Just ignore the attempt. + */ + return; + } + s->rx_fifo_len--; if (s->rx_fifo_len) { for (i = 0; i < s->rx_fifo_len; i++)