Skip to content

Commit

Permalink
CIFS: session servername can't be null
Browse files Browse the repository at this point in the history
remove impossible check

Pointed out by Coverity (CID 115422)

Signed-off-by: Steve French <smfrench@gmail.com>
Reviewed-by: Jeff Layton <jlayton@samba.org>
  • Loading branch information
Steve French committed Apr 1, 2015
1 parent c85c35f commit 8b7a454
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion fs/cifs/cifsencrypt.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
/*
* fs/cifs/cifsencrypt.c
*
* Encryption and hashing operations relating to NTLM, NTLMv2. See MS-NLMP
* for more detailed information
*
* Copyright (C) International Business Machines Corp., 2005,2013
* Author(s): Steve French (sfrench@us.ibm.com)
*
Expand Down Expand Up @@ -515,7 +518,8 @@ static int calc_ntlmv2_hash(struct cifs_ses *ses, char *ntlmv2_hash,
__func__);
return rc;
}
} else if (ses->serverName) {
} else {
/* We use ses->serverName if no domain name available */
len = strlen(ses->serverName);

server = kmalloc(2 + (len * 2), GFP_KERNEL);
Expand Down

0 comments on commit 8b7a454

Please sign in to comment.