summaryrefslogtreecommitdiffstats
path: root/fs/cifs
diff options
context:
space:
mode:
authorSteve French <stfrench@microsoft.com>2021-11-11 16:10:00 -0600
committerSteve French <stfrench@microsoft.com>2021-11-12 10:21:51 -0600
commit6b7895182ce398fa474af8cfc051754e6539c6b1 (patch)
treeb14e19724eb18a71fef885e19018fc96196cc5e0 /fs/cifs
parent4d9beec22f731655f1a41f91cd747a29892533e5 (diff)
downloadlinux-6b7895182ce398fa474af8cfc051754e6539c6b1.tar.bz2
smb3: add additional null check in SMB2_open
Although unlikely to be possible for rsp to be null here, the check is safer to add, and quiets a Coverity warning. Addresses-Coverity: 1418458 ("Explicit null dereferenced") Reviewed-by: Paulo Alcantara (SUSE) <pc@cjr.nz> Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/cifs')
-rw-r--r--fs/cifs/smb2pdu.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c
index 4dda26059aac..48679e0c8392 100644
--- a/fs/cifs/smb2pdu.c
+++ b/fs/cifs/smb2pdu.c
@@ -2941,7 +2941,9 @@ SMB2_open(const unsigned int xid, struct cifs_open_parms *oparms, __le16 *path,
tcon->need_reconnect = true;
}
goto creat_exit;
- } else
+ } else if (rsp == NULL) /* unlikely to happen, but safer to check */
+ goto creat_exit;
+ else
trace_smb3_open_done(xid, le64_to_cpu(rsp->PersistentFileId),
tcon->tid,
ses->Suid, oparms->create_options,