Commit 181724fc authored by Ekaterina Esina's avatar Ekaterina Esina Committed by Steve French
Browse files

cifs: fix check of rc in function generate_smb3signingkey



Remove extra check after condition, add check after generating key
for encryption. The check is needed to return non zero rc before
rewriting it with generating key for decryption.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Reviewed-by: default avatarPaulo Alcantara (SUSE) <pc@manguebit.com>
Fixes: d70e9fa5 ("cifs: try opening channels after mounting")
Signed-off-by: default avatarEkaterina Esina <eesina@astralinux.ru>
Co-developed-by: default avatarAnastasia Belova <abelova@astralinux.ru>
Signed-off-by: default avatarAnastasia Belova <abelova@astralinux.ru>
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
parent ff31ba19
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -458,6 +458,8 @@ generate_smb3signingkey(struct cifs_ses *ses,
				  ptriplet->encryption.context,
				  ses->smb3encryptionkey,
				  SMB3_ENC_DEC_KEY_SIZE);
		if (rc)
			return rc;
		rc = generate_key(ses, ptriplet->decryption.label,
				  ptriplet->decryption.context,
				  ses->smb3decryptionkey,
@@ -466,9 +468,6 @@ generate_smb3signingkey(struct cifs_ses *ses,
			return rc;
	}

	if (rc)
		return rc;

#ifdef CONFIG_CIFS_DEBUG_DUMP_KEYS
	cifs_dbg(VFS, "%s: dumping generated AES session keys\n", __func__);
	/*