Ignore these errors as they may be a follow on effect of device realisation failure. Ideally we should have an error ** to populate in own right, but that requires an API change. Mark FIXME.
Signed-off-by: Peter Crosthwaite <crosthwaite.pe...@gmail.com> --- hw/core/sysbus.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/hw/core/sysbus.c b/hw/core/sysbus.c index 3c58629..6fde10e 100644 --- a/hw/core/sysbus.c +++ b/hw/core/sysbus.c @@ -127,7 +127,12 @@ bool sysbus_has_mmio(SysBusDevice *dev, unsigned int n) static void sysbus_mmio_map_common(SysBusDevice *dev, int n, hwaddr addr, bool may_overlap, int priority) { - assert(n >= 0 && n < dev->num_mmio); + assert(n >= 0); + + if (n < dev->num_mmio) { + /* FIXME: Add an Error ** to this function for this condition */ + return; + } if (dev->mmio[n].addr == addr) { /* ??? region already mapped here. */ @@ -186,6 +191,10 @@ void sysbus_init_mmio(SysBusDevice *dev, MemoryRegion *memory) MemoryRegion *sysbus_mmio_get_region(SysBusDevice *dev, int n) { + if (n >= dev->num_mmio) { + /* FIXME: Add an Error ** to this function for this condition */ + return NULL; + } return dev->mmio[n].memory; } -- 1.9.1