Unionfs ODF: cleanup code in odf_create_hierarchy
authorErez Zadok <ezk@cs.sunysb.edu>
Thu, 29 Nov 2007 07:36:57 +0000 (02:36 -0500)
committerRachita Kothiyal <rachita@dewey.fsl.cs.sunysb.edu>
Thu, 1 May 2008 23:03:24 +0000 (19:03 -0400)
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
fs/unionfs/odf.c

index baed380125faeb2e821c04c27aa241d524c50f46..bd09433980fa253198ca3cf5afd21d4ce822d17f 100644 (file)
@@ -53,35 +53,30 @@ int __odf_create_hierarchy(struct dentry *odf_root)
        dentry = __odf_create_dir(odf_root, ODF_NS);
        if (IS_ERR(dentry)) {
                err = PTR_ERR(dentry);
-               dentry = NULL;
                goto out;
        }
        dput(dentry);
        dentry = __odf_create_dir(odf_root, ODF_IC);
        if (IS_ERR(dentry)) {
                err = PTR_ERR(dentry);
-               dentry = NULL;
                goto out;
        }
        dput(dentry);
        dentry = __odf_create_dir(odf_root, ODF_RC);
        if (IS_ERR(dentry)) {
                err = PTR_ERR(dentry);
-               dentry = NULL;
                goto out;
        }
        dput(dentry);
        dentry = __odf_create_dir(odf_root, ODF_SR);
        if (IS_ERR(dentry)) {
                err = PTR_ERR(dentry);
-               dentry = NULL;
                goto out;
        }
        dput(dentry);
        dentry = lookup_one_len(ODF_WH, odf_root, sizeof(ODF_WH) - 1);
        if (IS_ERR(dentry)) {
                err = PTR_ERR(dentry);
-               dentry = NULL;
                goto out;
        }
        if (unlikely(dentry->d_inode)) {
@@ -95,7 +90,8 @@ int __odf_create_hierarchy(struct dentry *odf_root)
        release_lower_nd(&lower_nd, err);
 
 out:
-       dput(dentry);
+       if (!err)
+               dput(dentry);
        return err;
 }