diff options
author | Detlev Zundel <dzu@denx.de> | 2009-07-13 16:01:18 +0200 |
---|---|---|
committer | Wolfgang Denk <wd@denx.de> | 2009-07-23 21:02:07 +0200 |
commit | ca95c9df0280f40e8e4befadbaae21fa67d92331 (patch) | |
tree | 48abbc7de7f8f5227c6cd510c35981400a949389 | |
parent | 982adfc610669482a32127282fe489857a92cfe3 (diff) | |
download | u-boot-imx-ca95c9df0280f40e8e4befadbaae21fa67d92331.zip u-boot-imx-ca95c9df0280f40e8e4befadbaae21fa67d92331.tar.gz u-boot-imx-ca95c9df0280f40e8e4befadbaae21fa67d92331.tar.bz2 |
Add error checking for unsupported OS types.
Signed-off-by: Detlev Zundel <dzu@denx.de>
-rw-r--r-- | common/cmd_bootm.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c index 5d5dd33..6b53807 100644 --- a/common/cmd_bootm.c +++ b/common/cmd_bootm.c @@ -1,5 +1,5 @@ /* - * (C) Copyright 2000-2006 + * (C) Copyright 2000-2009 * Wolfgang Denk, DENX Software Engineering, wd@denx.de. * * See file CREDITS for list of people who contributed to this @@ -548,7 +548,8 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) if (!relocated) { int i; for (i = 0; i < ARRAY_SIZE(boot_os); i++) - boot_os[i] += gd->reloc_off; + if (boot_os[i] != NULL) + boot_os[i] += gd->reloc_off; relocated = 1; } @@ -636,6 +637,16 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) #endif boot_fn = boot_os[images.os.os]; + + if (boot_fn == NULL) { + if (iflag) + enable_interrupts(); + printf ("ERROR: booting os '%s' (%d) is not supported\n", + genimg_get_os_name(images.os.os), images.os.os); + show_boot_progress (-8); + return 1; + } + boot_fn(0, argc, argv, &images); show_boot_progress (-9); |