diff options
author | Wei Yongjun <weiyongjun1@huawei.com> | 2021-05-19 17:16:57 +0300 |
---|---|---|
committer | Gao Xiang <xiang@kernel.org> | 2021-06-07 19:40:18 +0300 |
commit | 0508c1ad0f264a24c4643701823a45f6c9bd8146 (patch) | |
tree | 69d2da45e2e31d994e82d79ae5fa933843afd060 /fs/erofs | |
parent | 614124bea77e452aa6df7a8714e8bc820b489922 (diff) | |
download | linux-0508c1ad0f264a24c4643701823a45f6c9bd8146.tar.xz |
erofs: fix error return code in erofs_read_superblock()
'ret' will be overwritten to 0 if erofs_sb_has_sb_chksum() return true,
thus 0 will return in some error handling cases. Fix to return negative
error code -EINVAL instead of 0.
Link: https://lore.kernel.org/r/20210519141657.3062715-1-weiyongjun1@huawei.com
Fixes: b858a4844cfb ("erofs: support superblock checksum")
Cc: stable <stable@vger.kernel.org> # 5.5+
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Reviewed-by: Gao Xiang <xiang@kernel.org>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Gao Xiang <xiang@kernel.org>
Diffstat (limited to 'fs/erofs')
-rw-r--r-- | fs/erofs/super.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/erofs/super.c b/fs/erofs/super.c index bbf3bbd908e0..22991d22af5a 100644 --- a/fs/erofs/super.c +++ b/fs/erofs/super.c @@ -285,6 +285,7 @@ static int erofs_read_superblock(struct super_block *sb) goto out; } + ret = -EINVAL; blkszbits = dsb->blkszbits; /* 9(512 bytes) + LOG_SECTORS_PER_BLOCK == LOG_BLOCK_SIZE */ if (blkszbits != LOG_BLOCK_SIZE) { |