Generally all BMCs will use the fmc_model to hold their own flash and most will have a spi_model to hold the managed system's flash, but not all systems do. Add a simple NULL check to allow a system to set the spi_model as NULL to indicate it should not be instantiated.
Signed-off-by: Patrick Williams <patr...@stwcx.xyz> --- hw/arm/aspeed.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c index 11558b327b..617a1ecbdc 100644 --- a/hw/arm/aspeed.c +++ b/hw/arm/aspeed.c @@ -276,7 +276,11 @@ static void aspeed_board_init_flashes(AspeedSMCState *s, const char *flashtype, int unit0) { - int i ; + int i; + + if (!flashtype) { + return; + } for (i = 0; i < s->num_cs; ++i) { DriveInfo *dinfo = drive_get(IF_MTD, 0, unit0 + i); -- 2.34.1