From: Al Viro Date: Sun, 4 Jul 2010 08:23:11 +0000 (+0400) Subject: fix leak in __logfs_create() X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=256249584bda1a9357e2d29987a37f5b2df035f6;p=linux-beck.git 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 --- 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;