提交 1d353eb7 编写于 作者: J Jaegeuk Kim

f2fs: fix ERR_PTR returned by bio

This is to fix wrong error pointer handling flow reported by Dan.
Reported-by: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NChao Yu <chao@kernel.org>
Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册