Skip to content

Commit

Permalink
cifs: make decode_ascii_ssetup void return
Browse files Browse the repository at this point in the history
...rc is always set to 0.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Acked-by: Pavel Shilovsky <piastry@etersoft.ru>
Signed-off-by: Steve French <sfrench@us.ibm.com>
  • Loading branch information
Jeff Layton authored and Steve French committed Jun 24, 2013
1 parent ffa598a commit 7d06645
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions fs/cifs/sess.c
Original file line number Diff line number Diff line change
Expand Up @@ -310,19 +310,18 @@ decode_unicode_ssetup(char **pbcc_area, int bleft, struct cifs_ses *ses,
return;
}

static int decode_ascii_ssetup(char **pbcc_area, __u16 bleft,
struct cifs_ses *ses,
const struct nls_table *nls_cp)
static void decode_ascii_ssetup(char **pbcc_area, __u16 bleft,
struct cifs_ses *ses,
const struct nls_table *nls_cp)
{
int rc = 0;
int len;
char *bcc_ptr = *pbcc_area;

cifs_dbg(FYI, "decode sessetup ascii. bleft %d\n", bleft);

len = strnlen(bcc_ptr, bleft);
if (len >= bleft)
return rc;
return;

kfree(ses->serverOS);

Expand All @@ -339,7 +338,7 @@ static int decode_ascii_ssetup(char **pbcc_area, __u16 bleft,

len = strnlen(bcc_ptr, bleft);
if (len >= bleft)
return rc;
return;

kfree(ses->serverNOS);

Expand All @@ -352,16 +351,14 @@ static int decode_ascii_ssetup(char **pbcc_area, __u16 bleft,

len = strnlen(bcc_ptr, bleft);
if (len > bleft)
return rc;
return;

/* No domain field in LANMAN case. Domain is
returned by old servers in the SMB negprot response */
/* BB For newer servers which do not support Unicode,
but thus do return domain here we could add parsing
for it later, but it is not very important */
cifs_dbg(FYI, "ascii: bytes left %d\n", bleft);

return rc;
}

int decode_ntlmssp_challenge(char *bcc_ptr, int blob_len,
Expand Down Expand Up @@ -938,8 +935,7 @@ CIFS_SessSetup(const unsigned int xid, struct cifs_ses *ses,
}
decode_unicode_ssetup(&bcc_ptr, bytes_remaining, ses, nls_cp);
} else {
rc = decode_ascii_ssetup(&bcc_ptr, bytes_remaining,
ses, nls_cp);
decode_ascii_ssetup(&bcc_ptr, bytes_remaining, ses, nls_cp);
}

ssetup_exit:
Expand Down

0 comments on commit 7d06645

Please sign in to comment.