summaryrefslogtreecommitdiffstats
path: root/fs/namei.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2015-05-08 16:38:31 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2015-05-10 22:20:20 -0400
commitb5cd3397627ab7e200ee068ca39b9ca2d031f26d (patch)
treea923b90c4be1bb31c570658a68dfafd7a176794a /fs/namei.c
parentab10492345d1d629743c7e7d56532f4e5284c2c5 (diff)
downloadlinux-b5cd3397627ab7e200ee068ca39b9ca2d031f26d.tar.bz2
namei: may_follow_link() - lift terminate_walk() on failures into caller
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/namei.c')
-rw-r--r--fs/namei.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/namei.c b/fs/namei.c
index 6d4692d772f7..51e2214e820d 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -798,7 +798,6 @@ static inline int may_follow_link(struct nameidata *nd)
return 0;
audit_log_link_denied("follow_link", &nd->stack[0].link);
- terminate_walk(nd);
return -EACCES;
}
@@ -1980,8 +1979,10 @@ static int trailing_symlink(struct nameidata *nd)
{
const char *s;
int error = may_follow_link(nd);
- if (unlikely(error))
+ if (unlikely(error)) {
+ terminate_walk(nd);
return error;
+ }
nd->flags |= LOOKUP_PARENT;
nd->stack[0].name = NULL;
s = get_link(nd);