summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2025-10-28 00:11:45 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2026-01-13 15:18:08 -0500
commit151e3257d61941ac07a7daacdb66ddc645f6ca34 (patch)
tree7d87141b84e5ea1df3972d36eaf705b8739607d1
parent541003b576c3e3c328314398a6df76eb3cebf847 (diff)
downloadlinux-next-151e3257d61941ac07a7daacdb66ddc645f6ca34.tar.gz
linux-next-151e3257d61941ac07a7daacdb66ddc645f6ca34.zip
do_sys_openat2(): get rid of useless check, switch to CLASS(filename)
do_file_open() will do the right thing when given ERR_PTR() as name... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r--fs/open.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/fs/open.c b/fs/open.c
index 3d2e2a2554c5..ac8dedea8daf 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -1425,18 +1425,12 @@ static int do_sys_openat2(int dfd, const char __user *filename,
struct open_how *how)
{
struct open_flags op;
- struct filename *tmp __free(putname) = NULL;
- int err;
-
- err = build_open_flags(how, &op);
+ int err = build_open_flags(how, &op);
if (unlikely(err))
return err;
- tmp = getname(filename);
- if (IS_ERR(tmp))
- return PTR_ERR(tmp);
-
- return FD_ADD(how->flags, do_file_open(dfd, tmp, &op));
+ CLASS(filename, name)(filename);
+ return FD_ADD(how->flags, do_file_open(dfd, name, &op));
}
int do_sys_open(int dfd, const char __user *filename, int flags, umode_t mode)