aboutsummaryrefslogtreecommitdiff
path: root/hw/arm/highbank.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2014-04-04 17:42:33 +0100
committerPeter Maydell <peter.maydell@linaro.org>2014-04-04 17:46:11 +0100
commit3b418d0c45fccd850f9ad9eb4bf9bdcd96b8e6f7 (patch)
treec45b4fedbc0271621c1cb44dee6ad72206744d93 /hw/arm/highbank.c
parent5913815a17387a5e9825c734ccab760588471ee5 (diff)
hw/arm/highbank: Don't segfault on unknown CPU names
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>
Diffstat (limited to 'hw/arm/highbank.c')
-rw-r--r--hw/arm/highbank.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/hw/arm/highbank.c b/hw/arm/highbank.c
index f66d57b113..2a88b843e9 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) {
+ 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",