aboutsummaryrefslogtreecommitdiff
path: root/fs/namei.c
diff options
context:
space:
mode:
authorWang Ming2023-07-13 20:05:42 +0800
committerGreg Kroah-Hartman2023-09-13 09:42:27 +0200
commitb553ac4894e700c90b03f1875b5fa30d3c3cb326 (patch)
tree088977ad07008a58496b5eaa11a041f2401ba8ca /fs/namei.c
parente12214c7ad13516a422ec1d6e0eb79148885a032 (diff)
fs: Fix error checking for d_hash_and_lookup()
[ Upstream commit 0d5a4f8f775ff990142cdc810a84eae078589d27 ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'fs/namei.c')
-rw-r--r--fs/namei.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/namei.c b/fs/namei.c
index 5b3865ad9d05..4248647f1ab2 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -2859,7 +2859,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;