Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 48c54877 authored by Wang Ming's avatar Wang Ming Committed by Greg Kroah-Hartman
Browse files

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: 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>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 0c8c2053
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2603,7 +2603,7 @@ int path_pts(struct path *path)
	this.name = "pts";
	this.len = 3;
	child = d_hash_and_lookup(parent, &this);
	if (!child)
	if (IS_ERR_OR_NULL(child))
		return -ENOENT;

	path->dentry = child;