@@ -1759,7 +1759,6 @@ static inline u64 hash_name(const char *name)
static int link_path_walk(const char *name, struct nameidata *nd)
{
int err;
- int orig_depth = nd->depth;
while (*name=='/')
name++;
@@ -1868,7 +1867,7 @@ Walked:
}
terminate_walk(nd);
Err:
- while (unlikely(nd->depth > orig_depth))
+ while (unlikely(nd->depth))
put_link(nd);
return err;
OK:
@@ -2017,10 +2016,7 @@ static int trailing_symlink(struct nameidata *nd)
}
nd->inode = nd->path.dentry->d_inode;
nd->stack[0].name = NULL;
- error = link_path_walk(s, nd);
- if (unlikely(error))
- put_link(nd);
- return error;
+ return link_path_walk(s, nd);
}
static inline int lookup_last(struct nameidata *nd)