Commit 0d5a4f8f authored by Wang Ming's avatar Wang Ming Committed by Christian Brauner

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: eedf265a ("devpts: Make each mount of devpts an independent filesystem.")
Signed-off-by: default avatarWang Ming <machel@vivo.com>
Message-Id: <20230713120555.7025-1-machel@vivo.com>
Signed-off-by: default avatarChristian Brauner <brauner@kernel.org>
parent 5d1f903f
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment