summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2025-09-25 17:11:36 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2026-01-13 15:18:08 -0500
commit47b3b9bf93ec66ec2443f553c22e12e0475f1395 (patch)
treec527740dc29c6c8d016363738c35b0f337dcbed5 /kernel
parent151e3257d61941ac07a7daacdb66ddc645f6ca34 (diff)
simplify the callers of file_open_name()
It accepts ERR_PTR() for name and does the right thing in that case. That allows to simplify the logics in callers, making them trivial to switch to CLASS(filename). Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/acct.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/kernel/acct.c b/kernel/acct.c
index 2a2b3c874acd..812808e5b1b8 100644
--- a/kernel/acct.c
+++ b/kernel/acct.c
@@ -218,7 +218,6 @@ static int acct_on(const char __user *name)
/* Difference from BSD - they don't do O_APPEND */
const int open_flags = O_WRONLY|O_APPEND|O_LARGEFILE;
struct pid_namespace *ns = task_active_pid_ns(current);
- struct filename *pathname __free(putname) = getname(name);
struct file *original_file __free(fput) = NULL; // in that order
struct path internal __free(path_put) = {}; // in that order
struct file *file __free(fput_sync) = NULL; // in that order
@@ -226,8 +225,7 @@ static int acct_on(const char __user *name)
struct vfsmount *mnt;
struct fs_pin *old;
- if (IS_ERR(pathname))
- return PTR_ERR(pathname);
+ CLASS(filename, pathname)(name);
original_file = file_open_name(pathname, open_flags, 0);
if (IS_ERR(original_file))
return PTR_ERR(original_file);