diff options
author | Jaegeuk Kim <jaegeuk@kernel.org> | 2016-07-12 09:38:48 -0700 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2016-07-15 15:21:19 -0700 |
commit | 1d353eb7e43853335a3c535c204c4e86f82eaf66 (patch) | |
tree | 23a8b2b30eb3e96d598ac2c3c6606fdb2dbc3965 /fs/f2fs | |
parent | b56ab837a06f3042a54b17a2a4ab3300eb03ecf5 (diff) |
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')
-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) |