Skip to content

Commit

Permalink
hw/arm/highbank: Don't segfault on unknown CPU names
Browse files Browse the repository at this point in the history
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 <peter.maydell@linaro.org>
Reviewed-by: Rob Herring <rob.herring@linaro.org>
  • Loading branch information
pm215 committed Apr 4, 2014
1 parent 5913815 commit 3b418d0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions hw/arm/highbank.c
Expand Up @@ -233,6 +233,11 @@ static void calxeda_init(QEMUMachineInitArgs *args, enum cxmachines machine)
ARMCPU *cpu;
Error *err = NULL;

if (!oc) {
error_report("Unable to find CPU definition");
exit(1);
}

cpu = ARM_CPU(object_new(object_class_get_name(oc)));

object_property_set_int(OBJECT(cpu), MPCORE_PERIPHBASE, "reset-cbar",
Expand Down

0 comments on commit 3b418d0

Please sign in to comment.