[PATCH 1/1] fuse: fix memleak in fuse_writepage_locked

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
---
 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




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux