aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Rini <trini@ti.com>2013-07-01 09:09:23 -0400
committerTom Rini <trini@ti.com>2013-07-04 10:53:38 -0400
commitc479c1361ade3cf2346f41a922b85373ddff8a26 (patch)
treea98ffd5b84f4133ce8723a127ae3a145184bd68a
parenta544eaddccbc16cfa01482122ea364706988ff18 (diff)
cmd_bootm.c: Correct check/return for unsupported sub-commandHEADmaster
With the do_bootm_states re-organization, we have the call to any potential sub-commands in a single spot. If one fails, we can then stop right there and return to the caller. Prior to these calls we have already ensured that ret is zero so we will not be returning this error for some other case. Signed-off-by: Tom Rini <trini@ti.com> Tested-by: Andreas Bießmann <andreas.devel@googlemail.com>
-rw-r--r--common/cmd_bootm.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c
index 02a5013c0..a36e0197f 100644
--- a/common/cmd_bootm.c
+++ b/common/cmd_bootm.c
@@ -669,6 +669,13 @@ static int do_bootm_states(cmd_tbl_t *cmdtp, int flag, int argc,
if (!ret && (states & BOOTM_STATE_OS_PREP))
ret = boot_fn(BOOTM_STATE_OS_PREP, argc, argv, images);
+ /* Check for unsupported subcommand. */
+ if (ret) {
+ puts("subcommand not supported\n");
+ return ret;
+ }
+
+
#ifdef CONFIG_TRACE
/* Pretend to run the OS, then run a user command */
if (!ret && (states & BOOTM_STATE_OS_FAKE_GO)) {
@@ -699,8 +706,6 @@ err:
bootstage_error(BOOTSTAGE_ID_DECOMP_UNIMPL);
else if (ret == BOOTM_ERR_RESET)
do_reset(cmdtp, flag, argc, argv);
- else
- puts("subcommand not supported\n");
return ret;
}