Message ID | 20190715134211.23063-6-peter.maydell@linaro.org |
---|---|
State | New |
Headers | show |
Series | [PULL,01/10] target/arm: report ARMv8-A FP support for AArch32 -cpu max | expand |
diff --git a/hw/ssi/mss-spi.c b/hw/ssi/mss-spi.c index 918b1f3e821..4c9da5d2b28 100644 --- a/hw/ssi/mss-spi.c +++ b/hw/ssi/mss-spi.c @@ -165,7 +165,13 @@ spi_read(void *opaque, hwaddr addr, unsigned int size) case R_SPI_RX: s->regs[R_SPI_STATUS] &= ~S_RXFIFOFUL; s->regs[R_SPI_STATUS] &= ~S_RXCHOVRF; - ret = fifo32_pop(&s->rx_fifo); + if (fifo32_is_empty(&s->rx_fifo)) { + qemu_log_mask(LOG_GUEST_ERROR, + "%s: Reading empty RX_FIFO\n", + __func__); + } else { + ret = fifo32_pop(&s->rx_fifo); + } if (fifo32_is_empty(&s->rx_fifo)) { s->regs[R_SPI_STATUS] |= S_RXFIFOEMP; }