linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] fuse: fix memleak in fuse_writepage_locked
@ 2022-01-04 13:34 wanghonghui
  0 siblings, 0 replies; only message in thread
From: wanghonghui @ 2022-01-04 13:34 UTC (permalink / raw)
  To: miklos; +Cc: linux-fsdevel, wanghonghui

In function fuse_writepage_args_alloc, both wpa's memory and
wpa->ia.ap->pages's memory were allocated,but when failed
it only free wpa's memory

We need free wpa->ia.ap->pages's memory before free wpa

Signed-off-by: Wang Honghui <wanghonghui@ucloud.cn>
---
 fs/fuse/file.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index 829094451774..c89966d7dbcc 100644
--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -1949,6 +1949,7 @@ static int fuse_writepage_locked(struct page *page)
 err_nofile:
 	__free_page(tmp_page);
 err_free:
+	kfree(ap->pages);
 	kfree(wpa);
 err:
 	mapping_set_error(page->mapping, error);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2022-01-04 13:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-04 13:34 [PATCH 1/1] fuse: fix memleak in fuse_writepage_locked wanghonghui

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).