Skip to content

Commit 8908e75

Browse files
chaseyuJaegeuk Kim
authored andcommitted
f2fs: fix to verify tpage before releasing in f2fs_free_dic()
In below error path, tpages[i] could be NULL, fix to check it before releasing it. - f2fs_read_multi_pages - f2fs_alloc_dic - f2fs_free_dic Fixes: 61fbae2 ("f2fs: fix to avoid NULL pointer dereference") Signed-off-by: Chao Yu <[email protected]> Signed-off-by: Jaegeuk Kim <[email protected]>
1 parent fd26725 commit 8908e75

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

fs/f2fs/compress.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1333,6 +1333,8 @@ void f2fs_free_dic(struct decompress_io_ctx *dic)
13331333
for (i = 0; i < dic->cluster_size; i++) {
13341334
if (dic->rpages[i])
13351335
continue;
1336+
if (!dic->tpages[i])
1337+
continue;
13361338
unlock_page(dic->tpages[i]);
13371339
put_page(dic->tpages[i]);
13381340
}

0 commit comments

Comments
 (0)