summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/namei.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/namei.c b/fs/namei.c
index c6b996817bb..a7e994bb78c 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -2361,8 +2361,10 @@ static struct file *do_last(struct nameidata *nd, struct path *path,
BUG_ON(nd->flags & LOOKUP_RCU);
inode = path->dentry->d_inode;
error = -ENOENT;
- if (!inode)
- goto exit_dput;
+ if (!inode) {
+ path_to_nameidata(path, nd);
+ goto exit;
+ }
if (should_follow_link(inode, !symlink_ok)) {
if (nd->flags & LOOKUP_RCU) {