提交 32096ea1 编写于 作者: K Konstantin Khlebnikov 提交者: Christoph Hellwig

vfs: fix dentry leak in simple_fill_super()

put dentry if inode allocation failed, d_genocide() cannot release it
Signed-off-by: NKonstantin Khlebnikov <khlebnikov@openvz.org>
Signed-off-by: NChristoph Hellwig <hch@lst.de>
上级 994c0e99
无相关合并请求
......@@ -510,8 +510,10 @@ int simple_fill_super(struct super_block *s, unsigned long magic,
if (!dentry)
goto out;
inode = new_inode(s);
if (!inode)
if (!inode) {
dput(dentry);
goto out;
}
inode->i_mode = S_IFREG | files->mode;
inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
inode->i_fop = files->ops;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册
反馈
建议
客服 返回
顶部