From patchwork Tue Jun 16 20:03:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiko Thiery X-Patchwork-Id: 242514 List-Id: U-Boot discussion From: heiko.thiery at gmail.com (Heiko Thiery) Date: Tue, 16 Jun 2020 22:03:52 +0200 Subject: [PATCH v2 1/1] spl: fix ext4fs_mount return code handling Message-ID: <20200616200350.8054-1-heiko.thiery@gmail.com> From: Thomas Schaefer - 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. Signed-off-by: Thomas Schaefer [hthiery: slightly reword the commit message] Signed-off-by: Heiko Thiery Reviewed-by: Tom Rini --- v1 -> v2: - directly return -1 instead of goto end (Tom Rini). --- common/spl/spl_ext.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/spl/spl_ext.c b/common/spl/spl_ext.c index 3898041d10..d73f062762 100644 --- a/common/spl/spl_ext.c +++ b/common/spl/spl_ext.c @@ -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);