From: Heiko Thiery <heiko.thiery@gmail.com>
To: u-boot@lists.denx.de
Subject: [PATCH 1/1] spl: fix ext4fs_mount return code handling
Date: Tue, 16 Jun 2020 13:59:03 +0200 [thread overview]
Message-ID: <20200616115902.3966-1-heiko.thiery@gmail.com> (raw)
From: Thomas Schaefer <thomas.schaefer@kontron.com>
- 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 <thomas.schaefer@kontron.com>
[hthiery: slightly reword the commit message]
Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
---
common/spl/spl_ext.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/common/spl/spl_ext.c b/common/spl/spl_ext.c
index 3898041d10..c8d137ed98 100644
--- a/common/spl/spl_ext.c
+++ b/common/spl/spl_ext.c
@@ -32,6 +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
+ err = -1; /* ext4fs_mount returns 0 in case of error! */
goto end;
}
--
2.20.1
next reply other threads:[~2020-06-16 11:59 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-16 11:59 Heiko Thiery [this message]
2020-06-16 15:29 ` [PATCH 1/1] spl: fix ext4fs_mount return code handling Tom Rini
-- strict thread matches above, loose matches on Subject: below --
2020-06-16 9:45 Heiko Thiery
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200616115902.3966-1-heiko.thiery@gmail.com \
--to=heiko.thiery@gmail.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox