Commit 4d9beec2 authored by Steve French's avatar Steve French

smb3: add additional null check in SMB2_ioctl

Although unlikely for it to be possible for rsp to be null here,
the check is safer to add, and quiets a Coverity warning.

Addresses-Coverity: 1443909 ("Explicit Null dereference")
Reviewed-by: default avatarPaulo Alcantara (SUSE) <pc@cjr.nz>
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
parent 0e629048
...@@ -3162,6 +3162,16 @@ SMB2_ioctl(const unsigned int xid, struct cifs_tcon *tcon, u64 persistent_fid, ...@@ -3162,6 +3162,16 @@ SMB2_ioctl(const unsigned int xid, struct cifs_tcon *tcon, u64 persistent_fid,
if ((plen == NULL) || (out_data == NULL)) if ((plen == NULL) || (out_data == NULL))
goto ioctl_exit; goto ioctl_exit;
/*
* Although unlikely to be possible for rsp to be null and rc not set,
* adding check below is slightly safer long term (and quiets Coverity
* warning)
*/
if (rsp == NULL) {
rc = -EIO;
goto ioctl_exit;
}
*plen = le32_to_cpu(rsp->OutputCount); *plen = le32_to_cpu(rsp->OutputCount);
/* We check for obvious errors in the output buffer length and offset */ /* We check for obvious errors in the output buffer length and offset */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment