[PATCH v4 30/59] simplify the callers of do_open_execat()

Al Viro
2026-01-08T07:36:55Z

fs/exec.c | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/fs/exec.c b/fs/exec.c
index b7d8081d12ea..5b4110c7522e 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -815,14 +815,8 @@ static struct file *do_open_execat(int fd, struct filename *name, int flags)
*/
struct file *open_exec(const char *name)
{
- struct filename *filename = getname_kernel(name);
- struct file *f = ERR_CAST(filename);
-
- if (!IS_ERR(filename)) {
- f = do_open_execat(AT_FDCWD, filename, 0);
- putname(filename);
- }
- return f;
+ CLASS(filename_kernel, filename)(name);
+ return do_open_execat(AT_FDCWD, filename, 0);
}
EXPORT_SYMBOL(open_exec);

--
2.47.3