From 256249584bda1a9357e2d29987a37f5b2df035f6 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sun, 4 Jul 2010 12:23:11 +0400 Subject: fix leak in __logfs_create() if kmalloc fails, we still need to drop the inode, as we do on other failure exits. Signed-off-by: Al Viro --- fs/logfs/dir.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'fs') diff --git a/fs/logfs/dir.c b/fs/logfs/dir.c index 72d1893ddd3..675cc49197f 100644 --- a/fs/logfs/dir.c +++ b/fs/logfs/dir.c @@ -434,8 +434,11 @@ static int __logfs_create(struct inode *dir, struct dentry *dentry, int ret; ta = kzalloc(sizeof(*ta), GFP_KERNEL); - if (!ta) + if (!ta) { + inode->i_nlink--; + iput(inode); return -ENOMEM; + } ta->state = CREATE_1; ta->ino = inode->i_ino; -- cgit v1.2.3