Commit 1d353eb7 authored by Jaegeuk Kim's avatar Jaegeuk Kim

f2fs: fix ERR_PTR returned by bio

This is to fix wrong error pointer handling flow reported by Dan.
Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarChao Yu <chao@kernel.org>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent b56ab837
......@@ -1085,8 +1085,10 @@ static int f2fs_mpage_readpages(struct address_space *mapping,
}
if (bio == NULL) {
bio = f2fs_grab_bio(inode, block_nr, nr_pages);
if (IS_ERR(bio))
if (IS_ERR(bio)) {
bio = NULL;
goto set_error_page;
}
}
if (bio_add_page(bio, page, blocksize, 0) < blocksize)
......
Markdown is supported
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