Blob Blame History Raw
From: Anastasia Belova <abelova@astralinux.ru>
Date: Tue, 15 Nov 2022 17:27:01 +0300
Subject: [PATCH] cifs: add check for returning value of SMB2_close_init
Git-commit: d520de6cb42e88a1d008b54f935caf9fc05951da
References: bsc#1190317
Patch-mainline: v6.1-rc6

If the returning value of SMB2_close_init is an error-value,
exit the function.

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

Fixes: 352d96f3acc6 ("cifs: multichannel: move channel selection above transport layer")

Signed-off-by: Anastasia Belova <abelova@astralinux.ru>
Signed-off-by: Steve French <stfrench@microsoft.com>
Acked-by: Enzo Matsumiya <ematsumiya@suse.de>
---
 fs/cifs/smb2ops.c |    2 ++
 1 file changed, 2 insertions(+)

--- a/fs/cifs/smb2ops.c
+++ b/fs/cifs/smb2ops.c
@@ -1327,6 +1327,8 @@ smb2_set_ea(const unsigned int xid, stru
 	rqst[2].rq_iov = close_iov;
 	rqst[2].rq_nvec = 1;
 	rc = SMB2_close_init(tcon, &rqst[2], COMPOUND_FID, COMPOUND_FID, false);
+	if (rc)
+		goto sea_exit;
 	smb2_set_related(&rqst[2]);
 
 	rc = compound_send_recv(xid, ses, flags, 3, rqst,