Commit de659f42 authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] d_alloc_root() fixes: freevxfs

 - inode leak on d_alloc_root() failure
parent faf08523
...@@ -143,6 +143,7 @@ static int vxfs_fill_super(struct super_block *sbp, void *dp, int silent) ...@@ -143,6 +143,7 @@ static int vxfs_fill_super(struct super_block *sbp, void *dp, int silent)
struct vxfs_sb *rsbp; struct vxfs_sb *rsbp;
struct buffer_head *bp = NULL; struct buffer_head *bp = NULL;
u_long bsize; u_long bsize;
struct inode *root;
infp = kmalloc(sizeof(*infp), GFP_KERNEL); infp = kmalloc(sizeof(*infp), GFP_KERNEL);
if (!infp) { if (!infp) {
...@@ -208,8 +209,10 @@ static int vxfs_fill_super(struct super_block *sbp, void *dp, int silent) ...@@ -208,8 +209,10 @@ static int vxfs_fill_super(struct super_block *sbp, void *dp, int silent)
} }
sbp->s_op = &vxfs_super_ops; sbp->s_op = &vxfs_super_ops;
sbp->s_root = d_alloc_root(iget(sbp, VXFS_ROOT_INO)); root = iget(sbp, VXFS_ROOT_INO);
sbp->s_root = d_alloc_root(root);
if (!sbp->s_root) { if (!sbp->s_root) {
iput(root);
printk(KERN_WARNING "vxfs: unable to get root dentry.\n"); printk(KERN_WARNING "vxfs: unable to get root dentry.\n");
goto out_free_ilist; goto out_free_ilist;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment