cifs: smb2pdu: Fix potential NULL pointer dereference
authorGustavo A. R. Silva <garsilva@embeddedor.com>
Tue, 3 Apr 2018 21:00:40 +0000 (16:00 -0500)
committerSteve French <stfrench@microsoft.com>
Wed, 11 Apr 2018 21:44:58 +0000 (16:44 -0500)
commitc0953f2ed510c31a375193e9dbca9774e77fb4b7
tree410692c8d7f7cb41cc10545daf6ec41537154489
parent8837c70d531a1788f975c366c254a5cb973a5291
cifs: smb2pdu: Fix potential NULL pointer dereference

tcon->ses is being dereferenced before it is null checked, hence
there is a potential null pointer dereference.

Fix this by moving the pointer dereference after tcon->ses has
been properly null checked.

Addresses-Coverity-ID: 1467426 ("Dereference before null check")
Fixes: 93012bf98416 ("cifs: add server->vals->header_preamble_size")
Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Reviewed-by: Aurelien Aptel <aaptel@suse.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/cifs/smb2pdu.c