Skip to content

Commit

Permalink
CIFS: remove an unneeded NULL check
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Steve French <[email protected]>
  • Loading branch information
Dan Carpenter authored and smfrench committed May 20, 2015
1 parent 1dc92c4 commit 65c3b20
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/cifs/cifssmb.c
Original file line number Diff line number Diff line change
Expand Up @@ -4918,7 +4918,7 @@ CIFSGetDFSRefer(const unsigned int xid, struct cifs_ses *ses,
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;
Expand Down

0 comments on commit 65c3b20

Please sign in to comment.