projects/linux·commit 7e635452

Merge tag 'for-5.16-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux

7e635452 · Linus Torvalds <[email protected]> · 2021-11-26 11:24:32 -08:00

Pull btrfs fix from David Sterba:
 "One more fix to the lzo code, a missing put_page causing memory leaks
  when some error branches are taken"

* tag 'for-5.16-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux:
  btrfs: fix the memory leak caused in lzo_compress_pages()
Commit
7e63545264c3d1844189e47ac8a4dabc03e11d8b
Parents
1bff7d7e · daf87e95

Merge commit. Changes below are compared with the first parent: 1bff7d7e.

Changes

1 files changed · +2 −0

FileStatusAddDelContent
fs/btrfs/lzo.cmodified+2−0View file

fs/btrfs/lzo.c

View file
diff --git a/fs/btrfs/lzo.c b/fs/btrfs/lzo.c
index 9febb80..0fb90cb 100644
--- a/fs/btrfs/lzo.c
+++ b/fs/btrfs/lzo.c
@@ -290,6 +290,8 @@ int lzo_compress_pages(struct list_head *ws, struct address_space *mapping,
*total_out = cur_out;
*total_in = cur_in - start;
out:
+ if (page_in)
+ put_page(page_in);
*out_pages = DIV_ROUND_UP(cur_out, PAGE_SIZE);
return ret;
}