Skip to content

Commit 6b78951

Browse files
committed
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) <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent 4d9beec commit 6b78951

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

fs/cifs/smb2pdu.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2941,7 +2941,9 @@ SMB2_open(const unsigned int xid, struct cifs_open_parms *oparms, __le16 *path,
29412941
tcon->need_reconnect = true;
29422942
}
29432943
goto creat_exit;
2944-
} else
2944+
} else if (rsp == NULL) /* unlikely to happen, but safer to check */
2945+
goto creat_exit;
2946+
else
29452947
trace_smb3_open_done(xid, le64_to_cpu(rsp->PersistentFileId),
29462948
tcon->tid,
29472949
ses->Suid, oparms->create_options,

0 commit comments

Comments
 (0)