Panic when boot_flow_init() failed
Small oversight from CL Ieae7fe4ef5b3047174ec0ad057e487660ccd5a03.
Hafnium would continue to execute even if it could not parse the FDT.
Add a panic() in the caller to correct it.
Also fix a dlog message missing a newline.
Bug: 117551352
Change-Id: I9024800232013f92431db173315dfd379081d7f9
diff --git a/src/cpu.c b/src/cpu.c
index 43efa26..ea66af2 100644
--- a/src/cpu.c
+++ b/src/cpu.c
@@ -105,7 +105,7 @@
if (!found_boot_cpu) {
/* Boot CPU was initialized but with wrong ID. */
- dlog("Boot CPU's ID not found in config.");
+ dlog("Boot CPU's ID not found in config.\n");
cpus[0].id = boot_cpu_id;
}
}
diff --git a/src/main.c b/src/main.c
index 4b2c5b3..9b81be5 100644
--- a/src/main.c
+++ b/src/main.c
@@ -76,7 +76,9 @@
mm_stage1_locked = mm_lock_stage1();
- boot_flow_init(mm_stage1_locked, &manifest, ¶ms, &ppool);
+ if (!boot_flow_init(mm_stage1_locked, &manifest, ¶ms, &ppool)) {
+ panic("Could not parse data from FDT.");
+ }
cpu_module_init(params.cpu_ids, params.cpu_count);