提交 25624958 编写于 作者: A 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: NAl Viro <viro@zeniv.linux.org.uk>
上级 0e4f6a79
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册