summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2009-10-14 23:51:05 +0000
committerCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2009-10-14 23:51:05 +0000
commit74cb9eb7e75bceadb0ebd2eee5b26f27934e5750 (patch)
treeb9c9c5a9ff88a2d0fc8c17eb4ae15d025de9ff4b
parent75472d27e4b76d13812cf466d9defc51a4ecc851 (diff)
cbfs_and_run_core() did not check the return code of cbfs_load_stage()
and jumped to (void*)-1 on error. Die properly instead. I didn't use die() because that caused a linker error. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Myles Watson <mylesgw@gmail.com> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@4776 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
-rw-r--r--src/arch/i386/lib/cbfs_and_run.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/arch/i386/lib/cbfs_and_run.c b/src/arch/i386/lib/cbfs_and_run.c
index eaded11223..4e56964393 100644
--- a/src/arch/i386/lib/cbfs_and_run.c
+++ b/src/arch/i386/lib/cbfs_and_run.c
@@ -11,6 +11,11 @@ void cbfs_and_run_core(char *filename, unsigned ebp)
u8 *dst;
print_debug("Jumping to image.\r\n");
dst = cbfs_load_stage(filename);
+ if (dst == (void *) -1) {
+ /* We should use die() here. */
+ print_emerg("Loading stage failed!\n");
+ for (;;);
+ }
print_debug("Jumping to image.\r\n");
__asm__ volatile (