From: Philippe Mathieu-Daudé Date: Thu, 19 Oct 2023 10:01:59 +0000 (+0200) Subject: hw/ppc/spapr_vio: Realize SPAPR_VIO_BRIDGE device before accessing it X-Git-Tag: v8.2.0-rc0~59^2~23 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=880e26074c271e88235b453107fdfd40b0940f7f;p=thirdparty%2Fqemu.git hw/ppc/spapr_vio: Realize SPAPR_VIO_BRIDGE device before accessing it qbus_new() should not be called on unrealized device. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Cédric Le Goater Reviewed-by: Thomas Huth Message-Id: <20231019131647.19690-2-philmd@linaro.org> --- diff --git a/hw/ppc/spapr_vio.c b/hw/ppc/spapr_vio.c index 9d4fec2c04d..f8ef2b6fa87 100644 --- a/hw/ppc/spapr_vio.c +++ b/hw/ppc/spapr_vio.c @@ -574,13 +574,14 @@ SpaprVioBus *spapr_vio_bus_init(void) /* Create bridge device */ dev = qdev_new(TYPE_SPAPR_VIO_BRIDGE); - sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); /* Create bus on bridge device */ qbus = qbus_new(TYPE_SPAPR_VIO_BUS, dev, "spapr-vio"); bus = SPAPR_VIO_BUS(qbus); bus->next_reg = SPAPR_VIO_REG_BASE; + sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); + /* hcall-vio */ spapr_register_hypercall(H_VIO_SIGNAL, h_vio_signal);