From c7afb0f97700e73109564f83c35bfeeb14cb653b Mon Sep 17 00:00:00 2001
From: KaiGai Kohei <kaigai@ak.jp.nec.com>
Date: Sun, 2 Jul 2006 15:13:46 +0100
Subject: [JFFS2][XATTR] Fix memory leak in POSIX-ACL support

jffs2_clear_acl() which releases acl caches allocated by kmalloc()
was defined but it was never called. Thus, we faced to the risk
of memory leaking.

This patch plugs jffs2_clear_acl() into jffs2_do_clear_inode().
It ensures to release acl cache when inode is cleared.

Signed-off-by: KaiGai Kohei <kaigai@ak.jp.nec.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
---
 fs/jffs2/readinode.c | 1 +
 1 file changed, 1 insertion(+)

(limited to 'fs/jffs2/readinode.c')

diff --git a/fs/jffs2/readinode.c b/fs/jffs2/readinode.c
index cc1899268c4..266423b2709 100644
--- a/fs/jffs2/readinode.c
+++ b/fs/jffs2/readinode.c
@@ -968,6 +968,7 @@ void jffs2_do_clear_inode(struct jffs2_sb_info *c, struct jffs2_inode_info *f)
 	struct jffs2_full_dirent *fd, *fds;
 	int deleted;
 
+	jffs2_clear_acl(f);
 	jffs2_xattr_delete_inode(c, f->inocache);
 	down(&f->sem);
 	deleted = f->inocache && !f->inocache->nlink;
-- 
cgit v1.2.3-18-g5258