Skip to content

Commit 0508c1a

Browse files
Wei Yongjunhsiangkao
authored andcommitted
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: b858a48 ("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>
1 parent 614124b commit 0508c1a

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

fs/erofs/super.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,7 @@ static int erofs_read_superblock(struct super_block *sb)
285285
goto out;
286286
}
287287

288+
ret = -EINVAL;
288289
blkszbits = dsb->blkszbits;
289290
/* 9(512 bytes) + LOG_SECTORS_PER_BLOCK == LOG_BLOCK_SIZE */
290291
if (blkszbits != LOG_BLOCK_SIZE) {

0 commit comments

Comments
 (0)