Skip to content
Snippets Groups Projects
Commit 880e2607 authored by Philippe Mathieu-Daudé's avatar Philippe Mathieu-Daudé
Browse files

hw/ppc/spapr_vio: Realize SPAPR_VIO_BRIDGE device before accessing it


qbus_new() should not be called on unrealized device.

Signed-off-by: default avatarPhilippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: default avatarCédric Le Goater <clg@kaod.org>
Reviewed-by: default avatarThomas Huth <thuth@redhat.com>
Message-Id: <20231019131647.19690-2-philmd@linaro.org>
parent 0459c141
No related branches found
No related tags found
No related merge requests found
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment