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 B987AC4332F for ; Wed, 24 Nov 2021 12:23:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244613AbhKXM0p (ORCPT ); Wed, 24 Nov 2021 07:26:45 -0500 Received: from mail.kernel.org ([198.145.29.99]:42292 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244911AbhKXMYV (ORCPT ); Wed, 24 Nov 2021 07:24:21 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4DD3F6120A; Wed, 24 Nov 2021 12:14:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1637756088; bh=VV/bBnOZDYHR1gh+u3IYYs8hj4RG5PimviyhQM3l+k8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GcD2JXSBCwr3xUr2ki4mydOwNig5uuP+RXuk2i3RQRCG+gTE8H5J0iaeQ+ibhUEtU DKUMfnIlOEhfX/lawHMaLCF1v033WQNMQb1tFSMTi12oMNT4pHYd1tILgKT89sG6s0 qJAAEiVD/s7X4Q6gOg0ynwUfAM5TqxQsWJJOvmfI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, TOTE Robot , Jia-Ju Bai , Mike Marshall , Sasha Levin Subject: [PATCH 4.9 134/207] fs: orangefs: fix error return code of orangefs_revalidate_lookup() Date: Wed, 24 Nov 2021 12:56:45 +0100 Message-Id: <20211124115708.373002869@linuxfoundation.org> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20211124115703.941380739@linuxfoundation.org> References: <20211124115703.941380739@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jia-Ju Bai [ Upstream commit 4c2b46c824a78fc8190d8eafaaea5a9078fe7479 ] When op_alloc() returns NULL to new_op, no error return code of orangefs_revalidate_lookup() is assigned. To fix this bug, ret is assigned with -ENOMEM in this case. Fixes: 8bb8aefd5afb ("OrangeFS: Change almost all instances of the string PVFS2 to OrangeFS.") Reported-by: TOTE Robot Signed-off-by: Jia-Ju Bai Signed-off-by: Mike Marshall Signed-off-by: Sasha Levin --- fs/orangefs/dcache.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/orangefs/dcache.c b/fs/orangefs/dcache.c index 5355efba4bc8c..1942f9946ab77 100644 --- a/fs/orangefs/dcache.c +++ b/fs/orangefs/dcache.c @@ -25,8 +25,10 @@ static int orangefs_revalidate_lookup(struct dentry *dentry) gossip_debug(GOSSIP_DCACHE_DEBUG, "%s: attempting lookup.\n", __func__); new_op = op_alloc(ORANGEFS_VFS_OP_LOOKUP); - if (!new_op) + if (!new_op) { + ret = -ENOMEM; goto out_put_parent; + } new_op->upcall.req.lookup.sym_follow = ORANGEFS_LOOKUP_LINK_NO_FOLLOW; new_op->upcall.req.lookup.parent_refn = parent->refn; -- 2.33.0