smb3: don't set rc when used and unneeded in query_info_compound
authorSteve French <stfrench@microsoft.com>
Tue, 24 May 2022 01:54:04 +0000 (20:54 -0500)
committerSteve French <stfrench@microsoft.com>
Thu, 21 Jul 2022 15:40:03 +0000 (10:40 -0500)
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>
fs/cifs/smb2ops.c

index f26e125dd585e837437499e0314e7df07bc2a43a..5e754f6f5249c15915473612f08353a71a1a84f9 100644 (file)
@@ -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;