mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-11 13:27:06 +09:00
f2fs: fix ERR_PTR returned by bio
This is to fix wrong error pointer handling flow reported by Dan. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
@@ -1085,8 +1085,10 @@ submit_and_realloc:
|
||||
}
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user