[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 08/11] mips/boston: Fix boston_mach_init() error handling
From: |
Markus Armbruster |
Subject: |
Re: [PATCH 08/11] mips/boston: Fix boston_mach_init() error handling |
Date: |
Wed, 29 Apr 2020 08:33:11 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) |
Markus Armbruster <address@hidden> writes:
> 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.
Whoops!
>
> boston_mach_init() is wrong that way. The last calls treats an error
> as fatal. Do that for the prior ones, too.
>
> Fixes: df1d8a1f29f567567b9d20be685a4241282e7005
> Cc: Paul Burton <address@hidden>
> Cc: Aleksandar Rikalo <address@hidden>
> Signed-off-by: Markus Armbruster <address@hidden>
> ---
> hw/mips/boston.c | 13 +++++--------
> 1 file changed, 5 insertions(+), 8 deletions(-)
>
> diff --git a/hw/mips/boston.c b/hw/mips/boston.c
> index 98ecd25e8e..2832dfa6ae 100644
> --- a/hw/mips/boston.c
> +++ b/hw/mips/boston.c
> @@ -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);
- [PATCH 07/11] mips/malta: Fix create_cps() error handling, (continued)
- [PATCH 07/11] mips/malta: Fix create_cps() error handling, Markus Armbruster, 2020/04/24
- [PATCH 03/11] s390x/cpumodel: Fix harmless misuse of visit_check_struct(), Markus Armbruster, 2020/04/24
- [PATCH 10/11] arm/sabrelite: Consistently use &error_fatal in sabrelite_init(), Markus Armbruster, 2020/04/24
- [PATCH 01/11] nvdimm: Plug memory leak in uuid property setter, Markus Armbruster, 2020/04/24
- [PATCH 08/11] mips/boston: Fix boston_mach_init() error handling, Markus Armbruster, 2020/04/24
- Re: [PATCH 08/11] mips/boston: Fix boston_mach_init() error handling,
Markus Armbruster <=
- [PATCH 11/11] i386: Fix x86_cpu_load_model() error API violation, Markus Armbruster, 2020/04/24
- [PATCH 02/11] xen: Fix and improve handling of device_add usb-host errors, Markus Armbruster, 2020/04/24
- [PATCH 09/11] mips/boston: Plug memory leak in boston_mach_init(), Markus Armbruster, 2020/04/24