Blob Blame History Raw
From: Steve French <stfrench@microsoft.com>
Date: Mon, 23 May 2022 20:54:04 -0500
Subject: [PATCH] smb3: don't set rc when used and unneeded in
 query_info_compound
Git-commit: 9ccfc23a72b669678e4c9ccba98d3d91db1c04cf
References: bsc#1190317
Patch-mainline: v5.19-rc1

rc is not checked so should not be set coming back from open_cached_dir
(the cfid pointer is checked instead to see if open_cached_dir failed)

Addresses-Coverity: 1518021 ("Code maintainability issues  (UNUSED_VALUE)")
Reviewed-by: Ronnie Sahlberg <lsahlber@redhat.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Acked-by: Enzo Matsumiya <ematsumiya@suse.de>
---
 fs/cifs/smb2ops.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c
index 0d7feb9e609e..ed2f8a69658d 100644
--- a/fs/cifs/smb2ops.c
+++ b/fs/cifs/smb2ops.c
@@ -2700,7 +2700,7 @@ smb2_query_info_compound(const unsigned int xid, struct cifs_tcon *tcon,
 	memset(rsp_iov, 0, sizeof(rsp_iov));
 
 	if (!strcmp(path, ""))
-		rc = open_cached_dir(xid, tcon, path, cifs_sb, &cfid);
+		open_cached_dir(xid, tcon, path, cifs_sb, &cfid); /* cfid null if open dir failed */
 
 	memset(&open_iov, 0, sizeof(open_iov));
 	rqst[0].rq_iov = open_iov;
-- 
2.35.3