]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
file_getattr(): filename_lookup() accepts ERR_PTR() as filename
authorAl Viro <viro@zeniv.linux.org.uk>
Fri, 31 Oct 2025 05:02:50 +0000 (01:02 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Tue, 13 Jan 2026 20:18:07 +0000 (15:18 -0500)
no need to check it in the caller

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/file_attr.c

index 13cdb31a3e9472461b0cb5f7170f4770d065878b..ddd4939af7b6ecb60f14a65c37a8a3444152551b 100644 (file)
@@ -396,9 +396,6 @@ SYSCALL_DEFINE5(file_getattr, int, dfd, const char __user *, filename,
                return -EINVAL;
 
        name = getname_maybe_null(filename, at_flags);
-       if (IS_ERR(name))
-               return PTR_ERR(name);
-
        if (!name && dfd >= 0) {
                CLASS(fd, f)(dfd);
                if (fd_empty(f))