Commit 45be0882 authored by Steve French's avatar Steve French
Browse files

smb3: add missing null server pointer check



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: 88675b22 ("cifs: do not search for channel if server is terminating")
Reported-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: default avatarShyam Prasad N <sprasad@microsoft.com>
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
parent 54be6c6c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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++) {