fs: fix dentry leak in simple_fill_super()
PATCH 1/1 fs: fix dentry leak in simple_fill_super()
put dentry if inode allocation failed, d_genocide() cannot release it
Signed-off-by Konstantin Khlebnikov <[email protected]>
--- fs/libfs.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
fs/libfs.c +3 -1
@@ -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;
Jan Kara
reviewerQuoted 1 line · Konstantin Khlebnikov
put dentry if inode allocation failed,
d_genocide()cannot release it
Al is currently ill and Christoph Hellwig is taking care of fixes for
now. Added him to CC...
Honza
Quoted 27 lines
Signed-off-by Konstantin Khlebnikov <[email protected]>--- fs/libfs.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)fs/libfs.c +3
-2@@ -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; --To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Signature · 2 lines
Jan Kara <[email protected]> SUSE Labs, CR