Commit 932d3a65 authored by Markus Armbruster's avatar Markus Armbruster
Browse files

mips/boston: Fix boston_mach_init() error handling



The Error ** argument must be NULL, &error_abort, &error_fatal, or a
pointer to a variable containing NULL.  Passing an argument of the
latter kind twice without clearing it in between is wrong: if the
first call sets an error, it no longer points to NULL for the second
call.

boston_mach_init() is wrong that way.  The last calls treats an error
as fatal.  Do that for the prior ones, too.

Fixes: df1d8a1f
Cc: Paul Burton <pburton@wavecomp.com>
Cc: Aleksandar Rikalo <aleksandar.rikalo@rt-rk.com>
Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
Message-Id: <20200505101908.6207-8-armbru@redhat.com>
Reviewed-by: default avatarAleksandar Markovic <aleksandar.qemu.devel@gmail.com>
parent a729f9bc
Loading
Loading
Loading
Loading
+5 −8
Original line number Diff line number Diff line
@@ -458,14 +458,11 @@ static void boston_mach_init(MachineState *machine)
    sysbus_init_child_obj(OBJECT(machine), "cps", OBJECT(&s->cps),
                          sizeof(s->cps), TYPE_MIPS_CPS);
    object_property_set_str(OBJECT(&s->cps), machine->cpu_type, "cpu-type",
                            &err);
    object_property_set_int(OBJECT(&s->cps), machine->smp.cpus, "num-vp", &err);
    object_property_set_bool(OBJECT(&s->cps), true, "realized", &err);

    if (err != NULL) {
        error_report("%s", error_get_pretty(err));
        exit(1);
    }
                            &error_fatal);
    object_property_set_int(OBJECT(&s->cps), machine->smp.cpus, "num-vp",
                            &error_fatal);
    object_property_set_bool(OBJECT(&s->cps), true, "realized",
                             &error_fatal);

    sysbus_mmio_map_overlap(SYS_BUS_DEVICE(&s->cps), 0, 0, 1);