Skip to contentSkip to conversation

SPL: fat: Fix spl_parse_image_header() return value handling

PATCH In review Marek Vasut 6 participants 10 messages May 19, 2016 – Jun 19, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 SPL: fat: Fix spl_parse_image_header() return value handling

The spl_parse_image_header() can return 0 and it is not an error. Only treat non-zero return value as an error.

Cc Fabio Estevam <[email protected]>
Cc Peng Fan <[email protected]>
Cc Stefano Babic <[email protected]>
Cc Tom Rini <[email protected]>
---
 common/spl/spl_fat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
common/spl/spl_fat.c +1 -1
index 338ea2f..5b0d969 100644
@@ -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);
Signature · 1 line
2.7.0
#2 lore raw

PATCH 1/1 SPL: fat: Fix spl_parse_image_header() return value handling

In reply to Marek Vasut
Quoted 8 lines · Marek Vasut

The spl_parse_image_header() can return 0 and it is not an error. Only treat non-zero return value as an error.

Cc Fabio Estevam <[email protected]>
Cc Peng Fan <[email protected]>
Cc Stefano Babic <[email protected]>
Cc Tom Rini <[email protected]>

Regards,
Peng.

Quoted 20 lines

---
common/spl/spl_fat.c | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
common/spl/spl_fat.c +1 -1
index 338ea2f..5b0d969 100644
@@ -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);
Signature · 1 line
2.7.0
#3 lore raw

PATCH 1/1 SPL: fat: Fix spl_parse_image_header() return value handling

In reply to Marek Vasut
Quoted 18 lines · Marek Vasut

The spl_parse_image_header() can return 0 and it is not an error. Only treat non-zero return value as an error.

Cc Fabio Estevam <[email protected]>
Cc Peng Fan <[email protected]>
Cc Stefano Babic <[email protected]>
Cc Tom Rini <[email protected]>
---
 common/spl/spl_fat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
common/spl/spl_fat.c +0 -0
index 338ea2f..5b0d969 100644

common/spl/spl_fat.c int spl_load_image_fat(struct blk_desc *block_dev, · line 64

Quoted 8 lines
common/spl/spl_fat.c +1 -1
@@ -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);

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
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
=====================================================================
#4 lore raw

PATCH 1/1 SPL: fat: Fix spl_parse_image_header() return value handling

In reply to Marek Vasut
Quoted 8 lines · Marek Vasut

The spl_parse_image_header() can return 0 and it is not an error. Only treat non-zero return value as an error.

Cc Fabio Estevam <[email protected]>
Cc Peng Fan <[email protected]>
Cc Stefano Babic <[email protected]>
Cc Tom Rini <[email protected]>
Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160520/a2bfeb32/attachment.sig>
Reviewed-by Tested-by on v1 1/1
#5 lore raw
In reply to Marek Vasut

Hello Marek,

Am 20.05.2016 um 01:45 schrieb Marek Vasut:

Quoted 12 lines

The spl_parse_image_header() can return 0 and it is not an error. Only treat non-zero return value as an error.

Quoted 3 lines
---
  common/spl/spl_fat.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

Thanks!

So:

bye,
Heiko

Signature · 2 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
#6 lore raw
In reply to Marek Vasut
Quoted 12 lines · Marek Vasut

The spl_parse_image_header() can return 0 and it is not an error. Only treat non-zero return value as an error.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160523/13cf210b/attachment.sig>
Reviewed-by Reviewed-by Peng Fan Reviewed-by Stefano Babic Reviewed-by Tom Rini
#7 lore raw

Hi Tom,

Quoted 15 lines · Tom Rini
Quoted 12 lines · Marek Vasut

The spl_parse_image_header() can return 0 and it is not an error. Only treat non-zero return value as an error.

Quoted 1 line

Applied to u-boot/master, thanks!

Looks like something went wrong while applying this patch as Marek's authorship got lost:

commit d550e82e4efebf5995809e38e8fb029b8fe6e861

Author: Tom Rini <[email protected]>
Date:   Mon May 23 11:51:13 2016 -0400

SPL: fat: Fix spl_parse_image_header() return value handling

The spl_parse_image_header() can return 0 and it is not an error. Only treat non-zero return value as an error.

#8 lore raw
Quoted 18 lines · Fabio Estevam

Hi Tom,

Quoted 15 lines · Tom Rini
Quoted 12 lines · Marek Vasut

The spl_parse_image_header() can return 0 and it is not an error. Only treat non-zero return value as an error.

Quoted 4 lines
Quoted 1 line

Applied to u-boot/master, thanks!

Looks like something went wrong while applying this patch as Marek's authorship got lost:

Ah, you're right, nice catch :)

Tom, I don't really care, bug is fixed, you can leave it as it is.

Quoted 15 lines

commit d550e82e4efebf5995809e38e8fb029b8fe6e861

Author: Tom Rini <[email protected]>
Date:   Mon May 23 11:51:13 2016 -0400

SPL: fat: Fix spl_parse_image_header() return value handling

The spl_parse_image_header() can return 0 and it is not an error. Only treat non-zero return value as an error.

Signature · 2 lines
Best regards,
Marek Vasut
#9 lore raw
Quoted 19 lines · Marek Vasut
Quoted 18 lines · Fabio Estevam

Hi Tom,

Quoted 15 lines · Tom Rini
Quoted 12 lines · Marek Vasut

The spl_parse_image_header() can return 0 and it is not an error. Only treat non-zero return value as an error.

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

Applied to u-boot/master, thanks!

Looks like something went wrong while applying this patch as Marek's authorship got lost:

Ah, you're right, nice catch :)

Tom, I don't really care, bug is fixed, you can leave it as it is.

Ug! Sorry about that, I really don't know how that happened either.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160619/90036fb3/attachment.sig>