If the user passes an unknown CPU name via the '-cpu' option, exit with an error message rather than segfaulting.
Signed-off-by: Peter Maydell <[email protected]> --- hw/arm/highbank.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hw/arm/highbank.c b/hw/arm/highbank.c index f66d57b..03545aa 100644 --- a/hw/arm/highbank.c +++ b/hw/arm/highbank.c @@ -233,6 +233,11 @@ static void calxeda_init(QEMUMachineInitArgs *args, enum cxmachines machine) ARMCPU *cpu; Error *err = NULL; + if (!oc) { + fprintf(stderr, "Unable to find CPU definition\n"); + exit(1); + } + cpu = ARM_CPU(object_new(object_class_get_name(oc))); object_property_set_int(OBJECT(cpu), MPCORE_PERIPHBASE, "reset-cbar", -- 1.9.0
