Skip to content

Commit b59194c

Browse files
chaseyugregkh
authored andcommitted
f2fs: fix to avoid accessing invalid fio in f2fs_allocate_data_block()
[ Upstream commit 25ae837 ] 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: f608c38 ("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> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 1fd6a06 commit b59194c

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎fs/f2fs/segment.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3407,12 +3407,12 @@ void f2fs_allocate_data_block(struct f2fs_sb_info *sbi, struct page *page,
34073407
f2fs_inode_chksum_set(sbi, page);
34083408
}
34093409

3410-
if (F2FS_IO_ALIGNED(sbi))
3411-
fio->retry = false;
3412-
34133410
if (fio) {
34143411
struct f2fs_bio_info *io;
34153412

3413+
if (F2FS_IO_ALIGNED(sbi))
3414+
fio->retry = false;
3415+
34163416
INIT_LIST_HEAD(&fio->list);
34173417
fio->in_list = true;
34183418
io = sbi->write_io[fio->type] + fio->temp;

0 commit comments

Comments
 (0)