From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EC26CCE79D0 for ; Wed, 20 Sep 2023 12:01:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234929AbjITMBi (ORCPT ); Wed, 20 Sep 2023 08:01:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52868 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234991AbjITMBb (ORCPT ); Wed, 20 Sep 2023 08:01:31 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 93C27D9 for ; Wed, 20 Sep 2023 05:01:25 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DC6A4C433C8; Wed, 20 Sep 2023 12:01:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1695211285; bh=l6bLvtopecGIxG9goFVE60FvhMW5RXlGdMStFdnzAUQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2gJk3S7pTR6C1VwNzeeBhBXPHGjk3REqzoqr40MsYmjy0GWrvBl0bZ6fyBvTUkCJr 4dhWIAN1THae3GBA++2U2BiwKB0Gz2Jv2S+VuKt1l/48fvP36OneLUk5yt2l39zKgV /65sC3ju8ryEZKrp72zyzZEscWZlJ8gOP52ea+Tw= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Wang Ming , Christian Brauner , Sasha Levin Subject: [PATCH 4.14 036/186] fs: Fix error checking for d_hash_and_lookup() Date: Wed, 20 Sep 2023 13:28:59 +0200 Message-ID: <20230920112838.254962816@linuxfoundation.org> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230920112836.799946261@linuxfoundation.org> References: <20230920112836.799946261@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Wang Ming [ 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 Message-Id: <20230713120555.7025-1-machel@vivo.com> Signed-off-by: Christian Brauner Signed-off-by: Sasha Levin --- fs/namei.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/namei.c b/fs/namei.c index a8c36363e6b1e..b6de8f0a16077 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -2615,7 +2615,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; -- 2.40.1