Skip to content

Commit 02772fb

Browse files
chaseyuJaegeuk Kim
authored andcommitted
f2fs: compress: fix to avoid memory leak on cc->cpages
Memory allocated for storing compressed pages' poitner should be released after f2fs_write_compressed_pages(), otherwise it will cause memory leak issue. Signed-off-by: Chao Yu <[email protected]> Fixes: 4c8ff70 ("f2fs: support data compression") Signed-off-by: Jaegeuk Kim <[email protected]>
1 parent 3357af8 commit 02772fb

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
@@ -1385,6 +1385,8 @@ int f2fs_write_multi_pages(struct compress_ctx *cc,
13851385
err = f2fs_write_compressed_pages(cc, submitted,
13861386
wbc, io_type);
13871387
cops->destroy_compress_ctx(cc);
1388+
kfree(cc->cpages);
1389+
cc->cpages = NULL;
13881390
if (!err)
13891391
return 0;
13901392
f2fs_bug_on(F2FS_I_SB(cc->inode), err != -EAGAIN);

0 commit comments

Comments
 (0)