summaryrefslogtreecommitdiffstats
path: root/fs/logfs/dir.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2010-07-04 10:23:11 +0200
committerAl Viro <viro@zeniv.linux.org.uk>2010-08-09 22:47:28 +0200
commit256249584bda1a9357e2d29987a37f5b2df035f6 (patch)
tree266fa8425efb96dcb484e7fceb3a2d68610a1ba1 /fs/logfs/dir.c
parentFix reiserfs_file_release() (diff)
downloadlinux-256249584bda1a9357e2d29987a37f5b2df035f6.tar.xz
linux-256249584bda1a9357e2d29987a37f5b2df035f6.zip
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 <viro@zeniv.linux.org.uk>
Diffstat (limited to '')
-rw-r--r--fs/logfs/dir.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/logfs/dir.c b/fs/logfs/dir.c
index 72d1893ddd36..675cc49197fe 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;