diff mbox series

[v4,2/4] hw/i386/pc: Propagate error if HPET device creation failed

Message ID 20231020171509.87839-3-philmd@linaro.org
State New
Headers show
Series hw/audio/pcspk: Inline pcspk_init() | expand

Commit Message

Philippe Mathieu-Daudé Oct. 20, 2023, 5:15 p.m. UTC
Reported-by: Bernhard Beschow <shentey@gmail.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 hw/i386/pc.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Richard Henderson Oct. 22, 2023, 5:01 p.m. UTC | #1
On 10/20/23 10:15, Philippe Mathieu-Daudé wrote:
> Reported-by: Bernhard Beschow <shentey@gmail.com>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   hw/i386/pc.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~
diff mbox series

Patch

diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 2481c11e83..6750ed427a 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -1235,7 +1235,9 @@  bool pc_basic_device_init(struct PCMachineState *pcms,
         if (!compat) {
             qdev_prop_set_uint32(hpet, HPET_INTCAP, hpet_irqs);
         }
-        sysbus_realize_and_unref(SYS_BUS_DEVICE(hpet), &error_fatal);
+        if (!sysbus_realize_and_unref(SYS_BUS_DEVICE(hpet), errp)) {
+            return false;
+        }
         sysbus_mmio_map(SYS_BUS_DEVICE(hpet), 0, HPET_BASE);
 
         for (i = 0; i < IOAPIC_NUM_PINS; i++) {