Skip to contentSkip to conversation

spl: fix ext4fs_mount return code handling

PATCH New Heiko Thiery 2 participants 2 messages Jun 16, 2020 – Jul 17, 2020

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 spl: fix ext4fs_mount return code handling

From: Thomas Schaefer <[email protected]>

- Despite other ext4 filesystem functions, ext4fs_mount returns 0 in case of error.
- This leads to u-boot crash in case that an SD card
with valid partition table but without ext4 filesystem created in a partition is found on SD card.
- Fix this by returning a proper error code of '-1' from spl_load_image_ext function in case of ext4fs_mount error.

[hthiery: slightly reword the commit message]

---
v1 -> v2:
- directly return -1 instead of goto end (Tom Rini).
---

 common/spl/spl_ext.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
common/spl/spl_ext.c +1 -1
index 3898041d10..d73f062762 100644
@@ -32,7 +32,7 @@ int spl_load_image_ext(struct spl_image_info *spl_image,
 #ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
 		printf("%s: ext4fs mount err - %d\n", __func__, err);
 #endif
-		goto end;
+		return -1;
 	}
 
 	err = ext4fs_open(filename, &filelen);
Signature · 1 line
2.20.1
#1 lore raw

PATCH v2 1/1 spl: fix ext4fs_mount return code handling

Quoted 10 lines · Heiko Thiery

From: Thomas Schaefer <[email protected]>

- Despite other ext4 filesystem functions, ext4fs_mount returns 0 in case of error.
- This leads to u-boot crash in case that an SD card
with valid partition table but without ext4 filesystem created in a partition is found on SD card.
- Fix this by returning a proper error code of '-1' from spl_load_image_ext function in case of ext4fs_mount error.

Quoted 4 lines
[hthiery: slightly reword the commit message]

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: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200717/e5bd7160/attachment.sig>