diff --git a/hw/i2c/aspeed_i2c.c b/hw/i2c/aspeed_i2c.c index 83fb906bdc..765a98b698 100644 --- a/hw/i2c/aspeed_i2c.c +++ b/hw/i2c/aspeed_i2c.c @@ -272,7 +272,11 @@ static int aspeed_i2c_bus_send(AspeedI2CBus *bus) } while (bus->regs[reg_dma_len]) { uint8_t data; - aspeed_i2c_dma_read(bus, &data); + ret = aspeed_i2c_dma_read(bus, &data); + /* Check that we were able to read the DMA */ + if (ret) { + break; + } trace_aspeed_i2c_bus_send("DMA", bus->regs[reg_dma_len], bus->regs[reg_dma_len], data); ret = i2c_send(bus->bus, data);