From: Paulo Alcantara Date: Wed, 18 Jan 2023 16:36:31 +0000 (-0300) Subject: cifs: fix return of uninitialized rc in dfs_cache_update_tgthint() X-Git-Tag: v6.1.15~542 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=38044859deee1e00fcabf468a7f8442d276d855b;p=platform%2Fkernel%2Flinux-starfive.git cifs: fix return of uninitialized rc in dfs_cache_update_tgthint() [ 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 --- diff --git a/fs/cifs/dfs_cache.c b/fs/cifs/dfs_cache.c index 4302dc7..3bc1d34 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))