[SMB3] Missing null tcon check
authorSteve French <smfrench@gmail.com>
Sat, 26 Sep 2015 14:48:58 +0000 (09:48 -0500)
committerSteve French <smfrench@gmail.com>
Sat, 26 Sep 2015 14:48:58 +0000 (09:48 -0500)
Pointed out by Dan Carpenter via smatch code analysis tool

CC: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Steve French <steve.french@primarydata.com>
fs/cifs/smb2pdu.c

index ce83e2e..597a417 100644 (file)
@@ -922,7 +922,7 @@ SMB2_tcon(const unsigned int xid, struct cifs_ses *ses, const char *tree,
        if (tcon && tcon->bad_network_name)
                return -ENOENT;
 
-       if ((tcon->seal) &&
+       if ((tcon && tcon->seal) &&
            ((ses->server->capabilities & SMB2_GLOBAL_CAP_ENCRYPTION) == 0)) {
                cifs_dbg(VFS, "encryption requested but no server support");
                return -EOPNOTSUPP;