From: Jaegeuk Kim Date: Tue, 12 Jul 2016 16:38:48 +0000 (-0700) Subject: f2fs: fix ERR_PTR returned by bio X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=1d353eb7e43853335a3c535c204c4e86f82eaf66;p=linux-beck.git f2fs: fix ERR_PTR returned by bio This is to fix wrong error pointer handling flow reported by Dan. Reported-by: Dan Carpenter Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim --- 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)