Skip to content

Commit

Permalink
cifs: remove redundant check for null string pointer
Browse files Browse the repository at this point in the history
server_RFC1001_name is declared as a RFC1001_NAME_LEN_WITH_NULL sized
char array in struct TCP_Server_Info so the null pointer check on
server_RFC1001_name is redundant and can be removed.  Detected with
smatch:

fs/cifs/connect.c:2982 ip_rfc1001_connect() warn: this array is probably
  non-NULL. 'server->server_RFC1001_name'

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Steve French <smfrench@gmail.com>
  • Loading branch information
Colin Ian King authored and Steve French committed Feb 11, 2016
1 parent 74c7b2a commit 997152f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions fs/cifs/connect.c
Original file line number Diff line number Diff line change
Expand Up @@ -2999,8 +2999,7 @@ ip_rfc1001_connect(struct TCP_Server_Info *server)
if (ses_init_buf) {
ses_init_buf->trailer.session_req.called_len = 32;

if (server->server_RFC1001_name &&
server->server_RFC1001_name[0] != 0)
if (server->server_RFC1001_name[0] != 0)
rfc1002mangle(ses_init_buf->trailer.
session_req.called_name,
server->server_RFC1001_name,
Expand Down

0 comments on commit 997152f

Please sign in to comment.