aboutsummaryrefslogtreecommitdiff
path: root/hw/net/smc91c111.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/net/smc91c111.c')
-rw-r--r--hw/net/smc91c111.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/hw/net/smc91c111.c b/hw/net/smc91c111.c
index b18d5c2..0e13dfa 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++)