mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-03-16 04:04:06 +00:00
smb3: add missing null server pointer check
commit 45be0882c5f91e1b92e645001dd1a53b3bd58c97 upstream. Address static checker warning in cifs_ses_get_chan_index(): warn: variable dereferenced before check 'server' To be consistent, and reduce risk, we should add another check for null server pointer. Fixes: 88675b22d34e ("cifs: do not search for channel if server is terminating") Reported-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Shyam Prasad N <sprasad@microsoft.com> Signed-off-by: Steve French <stfrench@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
a7f34a0684
commit
824c15ad09
1 changed files with 1 additions and 1 deletions
|
@ -76,7 +76,7 @@ cifs_ses_get_chan_index(struct cifs_ses *ses,
|
|||
unsigned int i;
|
||||
|
||||
/* if the channel is waiting for termination */
|
||||
if (server->terminate)
|
||||
if (server && server->terminate)
|
||||
return CIFS_INVAL_CHAN_INDEX;
|
||||
|
||||
for (i = 0; i < ses->chan_count; i++) {
|
||||
|
|
Loading…
Add table
Reference in a new issue