Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -1085,9 +1085,11 @@ 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)
			goto submit_and_realloc;