forked from luck/tmp_suning_uos_patched
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>
This commit is contained in:
parent
0e4f6a791b
commit
256249584b
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue
Block a user