update the failure cleanup in may_follow_link() to match that.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
return 0;
audit_log_link_denied("follow_link", link);
return 0;
audit_log_link_denied("follow_link", link);
- path_put_conditional(link, nd);
path_put(&nd->path);
return -EACCES;
}
path_put(&nd->path);
return -EACCES;
}
BUG_ON(nd->flags & LOOKUP_RCU);
BUG_ON(nd->flags & LOOKUP_RCU);
- if (nd->link.mnt == nd->path.mnt)
- mntget(nd->link.mnt);
-
last->link = nd->link;
last->cookie = NULL;
nd->depth++;
last->link = nd->link;
last->cookie = NULL;
nd->depth++;
+ if (link->mnt == nd->path.mnt)
+ mntget(link->mnt);
error = nd_alloc_stack(nd);
if (unlikely(error)) {
error = nd_alloc_stack(nd);
if (unlikely(error)) {
- path_to_nameidata(link, nd);