Commit 517d6b9c authored by Wei Yongjun's avatar Wei Yongjun Committed by Gao Xiang
Browse files

erofs: fix return value check in erofs_read_superblock()

In case of error, the function read_mapping_page() returns
ERR_PTR() not NULL. The NULL test in the return value check
should be replaced with IS_ERR().

Fixes: fe7c2423

 ("erofs: use read_mapping_page instead of sb_bread")
Reviewed-by: default avatarGao Xiang <>
Reviewed-by: default avatarChao Yu <>
Signed-off-by: default avatarWei Yongjun <>

Signed-off-by: default avatarGao Xiang <>
parent 54ecb8f7
......@@ -105,9 +105,9 @@ static int erofs_read_superblock(struct super_block *sb)
int ret;
page = read_mapping_page(sb->s_bdev->bd_inode->i_mapping, 0, NULL);
if (!page) {
if (IS_ERR(page)) {
erofs_err(sb, "cannot read erofs superblock");
return -EIO;
return PTR_ERR(page);
sbi = EROFS_SB(sb);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment