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 15D46C38142 for ; Tue, 24 Jan 2023 13:45:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234473AbjAXNpU (ORCPT ); Tue, 24 Jan 2023 08:45:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35596 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234273AbjAXNos (ORCPT ); Tue, 24 Jan 2023 08:44:48 -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 62818474C7; Tue, 24 Jan 2023 05:43:32 -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 BF395B811EA; Tue, 24 Jan 2023 13:43:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 79CECC433EF; Tue, 24 Jan 2023 13:43:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1674567806; bh=aU13aZswrVBF+jlf0x4wFwaNBxGQzJ+noTS0NkOOf2U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZzVKW9BOs0LVuZnfezcVOir7QLHRKktuH15I31s7X9yLDeYCiWQztvbyHAjEQLA5k MKFfGpUr9eXZg+YpHAO+iKHsQHt3zK+1CVM3xT4r8Ma+moK+UgMuwFpx1husqNgakM axLhjxMGGiId5/8nq+t3h0AQ0TqAhZ/4qWQDz/VDhMbBX43q8V+S3QIpv+CclJeBcX dmGfzEyGMB/YuzjFzDi5GbBWxqlXRHLEXmQ3Iy8ZxfW/1mIO3d+ysV/qA9YC6zjWg3 L0lakbQi0UrAJ094shZEjf+9M6JvnsdKCql5WFQfTwSQSL8tc0pay1HVoEUe/VNJrj 6KdueM4CdDMCg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Paulo Alcantara , kernel test robot , Steve French , Sasha Levin , sfrench@samba.org, linux-cifs@vger.kernel.org, samba-technical@lists.samba.org Subject: [PATCH AUTOSEL 5.15 13/14] cifs: fix return of uninitialized rc in dfs_cache_update_tgthint() Date: Tue, 24 Jan 2023 08:42:56 -0500 Message-Id: <20230124134257.637523-13-sashal@kernel.org> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230124134257.637523-1-sashal@kernel.org> References: <20230124134257.637523-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore 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 1f3efa7821a0..935c5781d878 100644 --- a/fs/cifs/dfs_cache.c +++ b/fs/cifs/dfs_cache.c @@ -1046,10 +1046,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