aboutsummaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2025-09-25 17:02:28 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2026-01-13 15:18:07 -0500
commit2e2d64aea5c59ba976fced4bf44832ea425a3f3f (patch)
treed468d49b6cd7692c656ee1c009006634ed5ddb41 /fs
parentba33ac100d3feb1efb43b32e63cc0c6430936aa3 (diff)
do_filp_open(): DTRT when getting ERR_PTR() as pathname
The rest of the set_nameidata() callers treat IS_ERR(pathname) as "bail out immediately with PTR_ERR(pathname) as error". Makes life simpler for callers; do_filp_open() is the only exception and its callers would also benefit from such calling conventions change. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs')
-rw-r--r--fs/namei.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/namei.c b/fs/namei.c
index f4359825ba48..659c92a6d52c 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -4871,6 +4871,8 @@ struct file *do_filp_open(int dfd, struct filename *pathname,
int flags = op->lookup_flags;
struct file *filp;
+ if (IS_ERR(pathname))
+ return ERR_CAST(pathname);
set_nameidata(&nd, dfd, pathname, NULL);
filp = path_openat(&nd, op, flags | LOOKUP_RCU);
if (unlikely(filp == ERR_PTR(-ECHILD)))