[U-Boot] [PATCH v2 1/5] bootm: Handle errors consistently

Tom Rini trini at ti.com
Wed Jul 10 15:17:37 CEST 2013


On Thu, Jul 04, 2013 at 01:17:07PM -0700, Simon Glass wrote:

> A recent bootm fix left the error path incomplete. Reinstate this so that
> failures in bootm stages are handled properly.
> 
> Signed-off-by: Simon Glass <sjg at chromium.org>
> ---
> Changes in v2:
> - Correct checking in the no-error case
> 
>  common/cmd_bootm.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c
> index 02a5013..652513a 100644
> --- a/common/cmd_bootm.c
> +++ b/common/cmd_bootm.c
> @@ -684,12 +684,8 @@ static int do_bootm_states(cmd_tbl_t *cmdtp, int flag, int argc,
>  	if (!ret && (states & BOOTM_STATE_OS_GO)) {
>  		ret = boot_selected_os(argc, argv, BOOTM_STATE_OS_GO,
>  				images, boot_fn);
> -		if (ret)
> -			goto err;
>  	}
>  
> -	return ret;
> -
>  	/* Deal with any fallout */
>  err:
>  	if (iflag)
> @@ -699,7 +695,7 @@ err:
>  		bootstage_error(BOOTSTAGE_ID_DECOMP_UNIMPL);
>  	else if (ret == BOOTM_ERR_RESET)
>  		do_reset(cmdtp, flag, argc, argv);
> -	else
> +	else if (ret)
>  		puts("subcommand not supported\n");
>  
>  	return ret;

Looking this part over again, BOOTM_STATE_OS_GO handles its own prints
when returning 1, so we don't want to do the "subcommand not supported"
part here (the other case is a BOOTM_ERR_RESET).  But, trace does need
to be covered and isn't by the "subcommand not supported" print.  I'll
make a v3 of this shortly and post.

-- 
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/20130710/d75035b1/attachment.pgp>


More information about the U-Boot mailing list