aboutsummaryrefslogtreecommitdiffstats
path: root/fs/namei.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/namei.c')
-rw-r--r--fs/namei.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/fs/namei.c b/fs/namei.c
index 88baaf2b9167..4379ef989709 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -1123,21 +1123,20 @@ int vfs_path_lookup(struct dentry *dentry, struct vfsmount *mnt,
1123 nd->last_type = LAST_ROOT; 1123 nd->last_type = LAST_ROOT;
1124 nd->flags = flags; 1124 nd->flags = flags;
1125 nd->depth = 0; 1125 nd->depth = 0;
1126 nd->root.mnt = NULL;
1127 1126
1128 nd->path.dentry = dentry; 1127 nd->path.dentry = dentry;
1129 nd->path.mnt = mnt; 1128 nd->path.mnt = mnt;
1130 path_get(&nd->path); 1129 path_get(&nd->path);
1130 nd->root = nd->path;
1131 path_get(&nd->root);
1131 1132
1132 retval = path_walk(name, nd); 1133 retval = path_walk(name, nd);
1133 if (unlikely(!retval && !audit_dummy_context() && nd->path.dentry && 1134 if (unlikely(!retval && !audit_dummy_context() && nd->path.dentry &&
1134 nd->path.dentry->d_inode)) 1135 nd->path.dentry->d_inode))
1135 audit_inode(name, nd->path.dentry); 1136 audit_inode(name, nd->path.dentry);
1136 1137
1137 if (nd->root.mnt) { 1138 path_put(&nd->root);
1138 path_put(&nd->root); 1139 nd->root.mnt = NULL;
1139 nd->root.mnt = NULL;
1140 }
1141 1140
1142 return retval; 1141 return retval;
1143} 1142}