From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peng Fan Date: Fri, 20 May 2016 17:31:37 +0800 Subject: [U-Boot] [PATCH] SPL: fat: Fix spl_parse_image_header() return value handling In-Reply-To: <1463701524-8354-1-git-send-email-marex@denx.de> References: <1463701524-8354-1-git-send-email-marex@denx.de> Message-ID: <20160520093135.GC23014@linux-7smt.suse> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Fri, May 20, 2016 at 01:45:24AM +0200, 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 >Cc: Fabio Estevam >Cc: Peng Fan >Cc: Stefano Babic >Cc: Tom Rini Reviewed-by: Peng Fan Regards, Peng. >--- > 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); >-- >2.7.0 >