Skip to content

Commit

Permalink
coda: clean failure exits in coda_fill_super()
Browse files Browse the repository at this point in the history
same as for cifs, move iput() to the right place, make it unconditional

Signed-off-by: Al Viro <[email protected]>
  • Loading branch information
Al Viro committed Mar 21, 2012
1 parent 064326c commit f56b0fb
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions fs/coda/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,23 +208,20 @@ static int coda_fill_super(struct super_block *sb, void *data, int silent)
if (IS_ERR(root)) {
error = PTR_ERR(root);
printk("Failure of coda_cnode_make for root: error %d\n", error);
root = NULL;
goto error;
}

printk("coda_read_super: rootinode is %ld dev %s\n",
root->i_ino, root->i_sb->s_id);
sb->s_root = d_alloc_root(root);
if (!sb->s_root) {
iput(root);
error = -EINVAL;
goto error;
}
return 0;

error:
if (root)
iput(root);

mutex_lock(&vc->vc_mutex);
bdi_destroy(&vc->bdi);
vc->vc_sb = NULL;
Expand Down

0 comments on commit f56b0fb

Please sign in to comment.