Skip to contentSkip to conversation

cmd_bootm.c: Correct check/return for unsupported sub-command

PATCH New Tom Rini 2 participants 5 messages Jul 1, 2013 – Jul 4, 2013

lore
Share & tools
lore

Tom Rini

author
#0 lore raw

PATCH 1/1 cmd_bootm.c: Correct check/return for unsupported sub-command

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.

---
 common/cmd_bootm.c |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
common/cmd_bootm.c +7 -2
index 02a5013..a36e019 100644
@@ -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;
 }
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/1 cmd_bootm.c: Correct check/return for unsupported sub-command

Quoted 7 lines · Tom Rini

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.

on avr32

Quoted 3 lines
---
 common/cmd_bootm.c |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
author
#2 lore raw

PATCH 1/1 cmd_bootm.c: Correct check/return for unsupported sub-command

Quoted 10 lines · Andreas Bie?mann
Quoted 7 lines · Tom Rini

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.

Applied to u-boot/master.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20130703/969bcab8/attachment.pgp>
#3 lore raw

PATCH 1/1 cmd_bootm.c: Correct check/return for unsupported sub-command

Quoted 8 lines · Tom Rini
Quoted 7 lines · Andreas Bie?mann
Quoted 6 lines · Tom Rini

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.

Quoted 6 lines
Quoted 3 lines
Quoted 1 line

Applied to u-boot/master.

couldn't find it, missing push?

Regards,

Andreas Bie?mann

author
#4 lore raw

PATCH 1/1 cmd_bootm.c: Correct check/return for unsupported sub-command

Quoted 9 lines · Andreas Bie?mann
Quoted 8 lines · Tom Rini
Quoted 7 lines · Andreas Bie?mann
Quoted 6 lines · Tom Rini

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.

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
Quoted 1 line

Applied to u-boot/master.

couldn't find it, missing push?

Fixed, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20130704/2cb4ad22/attachment.pgp>