diff options
author | Chao Yu <yuchao0@huawei.com> | 2020-03-26 10:42:26 +0100 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2020-04-03 19:21:31 +0200 |
commit | 8908e753109fd7abb4949a3d6118a9a5e3766ea0 (patch) | |
tree | 04797ae33134e092a4f25ac8a2f5dec108d0b0f7 /fs/f2fs | |
parent | f2fs: show compression in statx (diff) | |
download | linux-8908e753109fd7abb4949a3d6118a9a5e3766ea0.tar.xz linux-8908e753109fd7abb4949a3d6118a9a5e3766ea0.zip |
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: 61fbae2b2b12 ("f2fs: fix to avoid NULL pointer dereference")
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs')
-rw-r--r-- | fs/f2fs/compress.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/f2fs/compress.c b/fs/f2fs/compress.c index ca4f54fbbd2e..df7b2d15eacd 100644 --- a/fs/f2fs/compress.c +++ b/fs/f2fs/compress.c @@ -1333,6 +1333,8 @@ void f2fs_free_dic(struct decompress_io_ctx *dic) for (i = 0; i < dic->cluster_size; i++) { if (dic->rpages[i]) continue; + if (!dic->tpages[i]) + continue; unlock_page(dic->tpages[i]); put_page(dic->tpages[i]); } |