mirror of
https://github.com/torvalds/linux.git
synced 2026-06-08 22:52:35 +02:00
f2fs: fix to avoid accessing invalid fio in f2fs_allocate_data_block()
[ Upstream commit25ae837e61] 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:f608c38c59("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>
This commit is contained in:
parent
1fd6a06410
commit
b59194c7ca
|
|
@ -3407,12 +3407,12 @@ void f2fs_allocate_data_block(struct f2fs_sb_info *sbi, struct page *page,
|
||||||
f2fs_inode_chksum_set(sbi, page);
|
f2fs_inode_chksum_set(sbi, page);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (F2FS_IO_ALIGNED(sbi))
|
|
||||||
fio->retry = false;
|
|
||||||
|
|
||||||
if (fio) {
|
if (fio) {
|
||||||
struct f2fs_bio_info *io;
|
struct f2fs_bio_info *io;
|
||||||
|
|
||||||
|
if (F2FS_IO_ALIGNED(sbi))
|
||||||
|
fio->retry = false;
|
||||||
|
|
||||||
INIT_LIST_HEAD(&fio->list);
|
INIT_LIST_HEAD(&fio->list);
|
||||||
fio->in_list = true;
|
fio->in_list = true;
|
||||||
io = sbi->write_io[fio->type] + fio->temp;
|
io = sbi->write_io[fio->type] + fio->temp;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user