[U-Boot] [PATCH] SPL: fat: Fix spl_parse_image_header() return value handling

Stefano Babic sbabic at denx.de
Fri May 20 11:36:02 CEST 2016


On 20/05/2016 01:45, Marek Vasut wrote:
> The spl_parse_image_header() can return 0 and it is not an error.
> Only treat non-zero return value as an error.
> 
> Signed-off-by: Marek Vasut <marex at denx.de>
> Cc: Fabio Estevam <fabio.estevam at nxp.com>
> Cc: Peng Fan <van.freenix at gmail.com>
> Cc: Stefano Babic <sbabic at denx.de>
> Cc: Tom Rini <trini at konsulko.com>
> ---
>  common/spl/spl_fat.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/common/spl/spl_fat.c b/common/spl/spl_fat.c
> index 338ea2f..5b0d969 100644
> --- a/common/spl/spl_fat.c
> +++ b/common/spl/spl_fat.c
> @@ -58,7 +58,7 @@ int spl_load_image_fat(struct blk_desc *block_dev,
>  		goto end;
>  
>  	err = spl_parse_image_header(header);
> -	if (err <= 0)
> +	if (err)
>  		goto end;
>  
>  	err = file_fat_read(filename, (u8 *)spl_image.load_addr, 0);
> 

Reviewed-by: Stefano Babic <sbabic at denx.de>

Best regards,
Stefano Babic

-- 
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================


More information about the U-Boot mailing list