coda: clean failure exits in coda_fill_super()
authorAl Viro <viro@zeniv.linux.org.uk>
Mon, 13 Feb 2012 02:15:58 +0000 (21:15 -0500)
committerAl Viro <viro@zeniv.linux.org.uk>
Wed, 21 Mar 2012 01:29:34 +0000 (21:29 -0400)
same as for cifs, move iput() to the right place, make it unconditional

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/coda/inode.c

index 5e2e1b3..32dafc8 100644 (file)
@@ -208,7 +208,6 @@ 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;
        } 
 
@@ -216,15 +215,13 @@ static int coda_fill_super(struct super_block *sb, void *data, int silent)
               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;