summaryrefslogtreecommitdiffstats
path: root/fs/namei.c
diff options
context:
space:
mode:
authorWang Ming <machel@vivo.com>2023-07-13 14:05:42 +0200
committerChristian Brauner <brauner@kernel.org>2023-07-14 17:01:23 +0200
commit0d5a4f8f775ff990142cdc810a84eae078589d27 (patch)
tree592c7d3664dc4bbfcca7943ac49577c8408b4c33 /fs/namei.c
parentattr: block mode changes of symlinks (diff)
downloadlinux-0d5a4f8f775ff990142cdc810a84eae078589d27.tar.xz
linux-0d5a4f8f775ff990142cdc810a84eae078589d27.zip
fs: Fix error checking for d_hash_and_lookup()
The d_hash_and_lookup() function returns error pointers or NULL. Most incorrect error checks were fixed, but the one in int path_pts() was forgotten. Fixes: eedf265aa003 ("devpts: Make each mount of devpts an independent filesystem.") Signed-off-by: Wang Ming <machel@vivo.com> Message-Id: <20230713120555.7025-1-machel@vivo.com> Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to '')
-rw-r--r--fs/namei.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/namei.c b/fs/namei.c
index e56ff39a79bc..2bae29ea52ff 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -2890,7 +2890,7 @@ int path_pts(struct path *path)
dput(path->dentry);
path->dentry = parent;
child = d_hash_and_lookup(parent, &this);
- if (!child)
+ if (IS_ERR_OR_NULL(child))
return -ENOENT;
path->dentry = child;