diff options
author | Jaegeuk Kim <jaegeuk@kernel.org> | 2016-07-12 19:38:48 +0300 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2016-07-16 01:21:19 +0300 |
commit | 1d353eb7e43853335a3c535c204c4e86f82eaf66 (patch) | |
tree | 23a8b2b30eb3e96d598ac2c3c6606fdb2dbc3965 /fs/f2fs/data.c | |
parent | b56ab837a06f3042a54b17a2a4ab3300eb03ecf5 (diff) | |
download | linux-1d353eb7e43853335a3c535c204c4e86f82eaf66.tar.xz |
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>
Diffstat (limited to 'fs/f2fs/data.c')
-rw-r--r-- | fs/f2fs/data.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 20b30162e7b4..650099597dd2 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -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) |