[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230713120555.7025-1-machel@vivo.com>
Date: Thu, 13 Jul 2023 20:05:42 +0800
From: Wang Ming <machel@...o.com>
To: Alexander Viro <viro@...iv.linux.org.uk>,
Christian Brauner <brauner@...nel.org>,
"Eric W. Biederman" <ebiederm@...ssion.com>,
linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org
Cc: opensource.kernel@...o.com, Wang Ming <machel@...o.com>
Subject: [PATCH v1] 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@...o.com>
---
fs/namei.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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;
--
2.25.1
Powered by blists - more mailing lists