]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
do_readlinkat(): switch to CLASS(filename_flags)
authorAl Viro <viro@zeniv.linux.org.uk>
Fri, 20 Sep 2024 16:35:42 +0000 (12:35 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Fri, 16 Jan 2026 17:52:03 +0000 (12:52 -0500)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/stat.c

index ee9ae2c3273a91525d4dcb43f230cb1ae3d2df34..d18577f3688cd6a6b98056c2c886e5139e932b52 100644 (file)
--- a/fs/stat.c
+++ b/fs/stat.c
@@ -564,20 +564,17 @@ static int do_readlinkat(int dfd, const char __user *pathname,
                         char __user *buf, int bufsiz)
 {
        struct path path;
-       struct filename *name;
        int error;
        unsigned int lookup_flags = 0;
 
        if (bufsiz <= 0)
                return -EINVAL;
 
-       name = getname_flags(pathname, LOOKUP_EMPTY);
+       CLASS(filename_flags, name)(pathname, LOOKUP_EMPTY);
 retry:
        error = filename_lookup(dfd, name, lookup_flags, &path, NULL);
-       if (unlikely(error)) {
-               putname(name);
+       if (unlikely(error))
                return error;
-       }
 
        /*
         * AFS mountpoints allow readlink(2) but are not symlinks
@@ -597,7 +594,6 @@ retry:
                lookup_flags |= LOOKUP_REVAL;
                goto retry;
        }
-       putname(name);
        return error;
 }