summaryrefslogtreecommitdiffstats
path: root/fs/namei.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/namei.c')
-rw-r--r--fs/namei.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/fs/namei.c b/fs/namei.c
index 7a33f074e5bd..18b9326d951f 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -2708,10 +2708,8 @@ out:
path_put(&nd->root);
if (base)
fput(base);
- if (od.filp) {
- BUG_ON(od.filp->f_path.dentry);
+ if (!(opened & FILE_OPENED))
put_filp(od.filp);
- }
if (res == ERR_PTR(-EOPENSTALE)) {
if (flags & LOOKUP_RCU)
res = ERR_PTR(-ECHILD);