f2fs: fix to avoid accessing invalid fio in f2fs_allocate_data_block()
authorChao Yu <yuchao0@huawei.com>
Fri, 2 Apr 2021 09:22:23 +0000 (17:22 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Tue, 6 Apr 2021 14:18:31 +0000 (07:18 -0700)
commit25ae837e61dee712b4b1df36602ebfe724b2a0b6
tree38667d23d8a4df39a7d8836e5a21188e8f955b3f
parenta303b0ac920d807cb7da4f1cd85759fbe44fa654
f2fs: fix to avoid accessing invalid fio in f2fs_allocate_data_block()

Callers may pass fio parameter with NULL value to f2fs_allocate_data_block(),
so we should make sure accessing fio's field after fio's validation check.

Fixes: f608c38c59c6 ("f2fs: clean up parameter of f2fs_allocate_data_block()")
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/segment.c