From: Dan Carpenter <dan.carpenter@oracle.com>
Date: Thu, 30 Apr 2015 14:30:24 +0000 (+0300)
Subject: CIFS: remove an unneeded NULL check
X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=65c3b205ebe06a389a29544e71a8071da0ce4155;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git

CIFS: remove an unneeded NULL check

Smatch complains because we dereference "ses->server" without checking
some lines earlier inside the call to get_next_mid(ses->server).

	fs/cifs/cifssmb.c:4921 CIFSGetDFSRefer()
	warn: variable dereferenced before check 'ses->server' (see line 4899)

There is only one caller for this function get_dfs_path() and it always
passes a non-null "ses->server" pointer so this NULL check can be
removed.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Steve French <smfrench@gmail.com>
---

diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c
index 1091affba425..f26ffbfc64d8 100644
--- a/fs/cifs/cifssmb.c
+++ b/fs/cifs/cifssmb.c
@@ -4918,7 +4918,7 @@ getDFSRetry:
 		strncpy(pSMB->RequestFileName, search_name, name_len);
 	}
 
-	if (ses->server && ses->server->sign)
+	if (ses->server->sign)
 		pSMB->hdr.Flags2 |= SMBFLG2_SECURITY_SIGNATURE;
 
 	pSMB->hdr.Uid = ses->Suid;