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 10CC6C636CC for ; Fri, 3 Feb 2023 10:22:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233303AbjBCKWr (ORCPT ); Fri, 3 Feb 2023 05:22:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45286 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233405AbjBCKWm (ORCPT ); Fri, 3 Feb 2023 05:22:42 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD1B99D048 for ; Fri, 3 Feb 2023 02:22:27 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 2234CB82A72 for ; Fri, 3 Feb 2023 10:22:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 69766C4339B; Fri, 3 Feb 2023 10:22:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1675419742; bh=Kfm10YM4wOU9MMngm6aaYAT2Dw2J8RCuxn/H1CXoZ0Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Y6Ns3rNYGF2L5dkiuwJ/IqQPLcBMfsU6TL5c/biQNqBBEVEWrPQCVnSkTl88mga8+ /JVzLwo6PjlaQREJdCvSxPzj1YyCAfLKaCa3+7pGMc67ExKwDiTA5/jy2M8HCL/LtF KjHIkOt/lQJgQ7S8yrGkdNDIYS9bMwq0I7AhiIrY= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, kernel test robot , "Paulo Alcantara (SUSE)" , Steve French , Sasha Levin Subject: [PATCH 6.1 22/28] cifs: fix return of uninitialized rc in dfs_cache_update_tgthint() Date: Fri, 3 Feb 2023 11:13:10 +0100 Message-Id: <20230203101010.917245367@linuxfoundation.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230203101009.946745030@linuxfoundation.org> References: <20230203101009.946745030@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Paulo Alcantara [ Upstream commit d6a49e8c4ca4d399ed65ac219585187fc8c2e2b1 ] Fix this by initializing rc to 0 as cache_refresh_path() would not set it in case of success. Reported-by: kernel test robot Link: https://lore.kernel.org/all/202301190004.bEHvbKG6-lkp@intel.com/ Signed-off-by: Paulo Alcantara (SUSE) Signed-off-by: Steve French Signed-off-by: Sasha Levin --- fs/cifs/dfs_cache.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/cifs/dfs_cache.c b/fs/cifs/dfs_cache.c index 4302dc75843c..3bc1d3494be3 100644 --- a/fs/cifs/dfs_cache.c +++ b/fs/cifs/dfs_cache.c @@ -1050,10 +1050,10 @@ int dfs_cache_update_tgthint(const unsigned int xid, struct cifs_ses *ses, const struct nls_table *cp, int remap, const char *path, const struct dfs_cache_tgt_iterator *it) { - int rc; - const char *npath; - struct cache_entry *ce; struct cache_dfs_tgt *t; + struct cache_entry *ce; + const char *npath; + int rc = 0; npath = dfs_cache_canonical_path(path, cp, remap); if (IS_ERR(npath)) -- 2.39.0