smb3: add missing null server pointer check
authorSteve French <stfrench@microsoft.com>
Mon, 5 Feb 2024 20:43:17 +0000 (14:43 -0600)
committerSteve French <stfrench@microsoft.com>
Thu, 8 Feb 2024 16:50:40 +0000 (10:50 -0600)
commit45be0882c5f91e1b92e645001dd1a53b3bd58c97
tree033a9272806d208479c9f55ace4c173da7fcfe60
parent54be6c6c5ae8e0d93a6c4641cb7528eb0b6ba478
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: 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>
fs/smb/client/sess.c