diff options
author | Yang Yingliang <yangyingliang@huawei.com> | 2021-05-10 13:10:51 +0200 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2021-06-17 16:53:20 +0200 |
commit | 8f6840c4fd1e7bd715e403074fb161c1a04cda73 (patch) | |
tree | 3cf4e01b3005a7cc74be1b521b4f43ce3962f722 /fs | |
parent | ext4: cleanup in-core orphan list if ext4_truncate() failed to get a transact... (diff) | |
download | linux-8f6840c4fd1e7bd715e403074fb161c1a04cda73.tar.xz linux-8f6840c4fd1e7bd715e403074fb161c1a04cda73.zip |
ext4: return error code when ext4_fill_flex_info() fails
After commit c89128a00838 ("ext4: handle errors on
ext4_commit_super"), 'ret' may be set to 0 before calling
ext4_fill_flex_info(), if ext4_fill_flex_info() fails ext4_mount()
doesn't return error code, it makes 'root' is null which causes crash
in legacy_get_tree().
Fixes: c89128a00838 ("ext4: handle errors on ext4_commit_super")
Reported-by: Hulk Robot <hulkci@huawei.com>
Cc: <stable@vger.kernel.org> # v4.18+
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20210510111051.55650-1-yangyingliang@huawei.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ext4/super.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 7e05973d410a..3b6203543607 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -5065,6 +5065,7 @@ no_journal: ext4_msg(sb, KERN_ERR, "unable to initialize " "flex_bg meta info!"); + ret = -ENOMEM; goto failed_mount6; } |