]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
erofs: fix error return code in erofs_read_superblock()
authorWei Yongjun <weiyongjun1@huawei.com>
Wed, 19 May 2021 14:16:57 +0000 (14:16 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Jul 2021 15:00:31 +0000 (17:00 +0200)
commitf214aa65dca43237af7377d9d06d4634a217aa04
tree88bf19d02f7822ce50f88ba650391e0e8589acfd
parent3adb14e48bc46884398880efe206ca62759b7d3d
erofs: fix error return code in erofs_read_superblock()

commit 0508c1ad0f264a24c4643701823a45f6c9bd8146 upstream.

'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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/erofs/super.c