Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 32096ea1 authored by Konstantin Khlebnikov's avatar Konstantin Khlebnikov Committed by Christoph Hellwig
Browse files

vfs: fix dentry leak in simple_fill_super()



put dentry if inode allocation failed, d_genocide() cannot release it

Signed-off-by: default avatarKonstantin Khlebnikov <khlebnikov@openvz.org>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
parent 994c0e99
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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;