From: Steve French Date: Sat, 26 Sep 2015 14:48:58 +0000 (-0500) Subject: [SMB3] Missing null tcon check X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ff9f84b7d79ddccab4c293c9d3e289f95ae594f7;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git [SMB3] Missing null tcon check Pointed out by Dan Carpenter via smatch code analysis tool CC: Dan Carpenter Signed-off-by: Steve French --- diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c index ce83e2edbe0a..597a417ba94d 100644 --- a/fs/cifs/smb2pdu.c +++ b/fs/cifs/smb2pdu.c @@ -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;