vfs: do_dentry_open(): don't put filp
[deliverable/linux.git] / fs / open.c
index 9daa1cea52fcf6e7b4d79e35e6570f9589a91b64..511c548b0997c8d7ff7c3271bec8c17b1674344b 100644 (file)
--- a/fs/open.c
+++ b/fs/open.c
@@ -747,7 +747,6 @@ cleanup_all:
        f->f_path.dentry = NULL;
        f->f_path.mnt = NULL;
 cleanup_file:
-       put_filp(f);
        dput(dentry);
        mntput(mnt);
        return ERR_PTR(error);
@@ -765,6 +764,8 @@ static struct file *__dentry_open(struct dentry *dentry, struct vfsmount *mnt,
                        fput(res);
                        res = ERR_PTR(error);
                }
+       } else {
+               put_filp(f);
        }
        return res;
 }
This page took 0.023808 seconds and 5 git commands to generate.