diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2011-07-17 22:24:15 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2011-07-17 23:22:17 -0400 |
commit | 3cc0658e35124ace881f6942839dcae877c3eaed (patch) | |
tree | 651cd3a34747a65c966168f1099489a8bc874d82 /fs/hppfs | |
parent | 0577d1ba411f9c40693b8b3e4aa7e0892cd03091 (diff) |
hppfs: fix dentry leak
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/hppfs')
-rw-r--r-- | fs/hppfs/hppfs.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/fs/hppfs/hppfs.c b/fs/hppfs/hppfs.c index 87ed48e0343d..7d6a0e92bcf0 100644 --- a/fs/hppfs/hppfs.c +++ b/fs/hppfs/hppfs.c | |||
@@ -174,13 +174,11 @@ static struct dentry *hppfs_lookup(struct inode *ino, struct dentry *dentry, | |||
174 | err = -ENOMEM; | 174 | err = -ENOMEM; |
175 | inode = get_inode(ino->i_sb, proc_dentry); | 175 | inode = get_inode(ino->i_sb, proc_dentry); |
176 | if (!inode) | 176 | if (!inode) |
177 | goto out_dput; | 177 | goto out; |
178 | 178 | ||
179 | d_add(dentry, inode); | 179 | d_add(dentry, inode); |
180 | return NULL; | 180 | return NULL; |
181 | 181 | ||
182 | out_dput: | ||
183 | dput(proc_dentry); | ||
184 | out: | 182 | out: |
185 | return ERR_PTR(err); | 183 | return ERR_PTR(err); |
186 | } | 184 | } |
@@ -690,8 +688,10 @@ static struct inode *get_inode(struct super_block *sb, struct dentry *dentry) | |||
690 | struct inode *proc_ino = dentry->d_inode; | 688 | struct inode *proc_ino = dentry->d_inode; |
691 | struct inode *inode = new_inode(sb); | 689 | struct inode *inode = new_inode(sb); |
692 | 690 | ||
693 | if (!inode) | 691 | if (!inode) { |
692 | dput(dentry); | ||
694 | return ERR_PTR(-ENOMEM); | 693 | return ERR_PTR(-ENOMEM); |
694 | } | ||
695 | 695 | ||
696 | if (S_ISDIR(dentry->d_inode->i_mode)) { | 696 | if (S_ISDIR(dentry->d_inode->i_mode)) { |
697 | inode->i_op = &hppfs_dir_iops; | 697 | inode->i_op = &hppfs_dir_iops; |
@@ -704,7 +704,7 @@ static struct inode *get_inode(struct super_block *sb, struct dentry *dentry) | |||
704 | inode->i_fop = &hppfs_file_fops; | 704 | inode->i_fop = &hppfs_file_fops; |
705 | } | 705 | } |
706 | 706 | ||
707 | HPPFS_I(inode)->proc_dentry = dget(dentry); | 707 | HPPFS_I(inode)->proc_dentry = dentry; |
708 | 708 | ||
709 | inode->i_uid = proc_ino->i_uid; | 709 | inode->i_uid = proc_ino->i_uid; |
710 | inode->i_gid = proc_ino->i_gid; | 710 | inode->i_gid = proc_ino->i_gid; |
@@ -737,7 +737,7 @@ static int hppfs_fill_super(struct super_block *sb, void *d, int silent) | |||
737 | sb->s_fs_info = proc_mnt; | 737 | sb->s_fs_info = proc_mnt; |
738 | 738 | ||
739 | err = -ENOMEM; | 739 | err = -ENOMEM; |
740 | root_inode = get_inode(sb, proc_mnt->mnt_sb->s_root); | 740 | root_inode = get_inode(sb, dget(proc_mnt->mnt_sb->s_root)); |
741 | if (!root_inode) | 741 | if (!root_inode) |
742 | goto out_mntput; | 742 | goto out_mntput; |
743 | 743 | ||