Commit 25624958 authored by Al Viro's avatar Al Viro

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: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 0e4f6a79
...@@ -434,8 +434,11 @@ static int __logfs_create(struct inode *dir, struct dentry *dentry, ...@@ -434,8 +434,11 @@ static int __logfs_create(struct inode *dir, struct dentry *dentry,
int ret; int ret;
ta = kzalloc(sizeof(*ta), GFP_KERNEL); ta = kzalloc(sizeof(*ta), GFP_KERNEL);
if (!ta) if (!ta) {
inode->i_nlink--;
iput(inode);
return -ENOMEM; return -ENOMEM;
}
ta->state = CREATE_1; ta->state = CREATE_1;
ta->ino = inode->i_ino; ta->ino = inode->i_ino;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment