diff options
author | 2013-10-16 09:09:49 -0600 | |
---|---|---|
committer | 2013-10-28 09:31:36 -0500 | |
commit | 944d6f1a5b8f42a780a65378e5f52bea3ae0ce07 (patch) | |
tree | dbb65a46368cee19de7f885c5f470d3bb976e064 /fs/cifs | |
parent | Query file system attributes from server on SMB2, not just cifs, mounts (diff) | |
download | linux-944d6f1a5b8f42a780a65378e5f52bea3ae0ce07.tar.gz linux-944d6f1a5b8f42a780a65378e5f52bea3ae0ce07.tar.bz2 linux-944d6f1a5b8f42a780a65378e5f52bea3ae0ce07.zip |
cifs: Remove redundant multiplex identifier check from check_smb_hdr()
The only call site for check_smb_header() assigns 'mid' from the SMB
packet, which is then checked again in check_smb_header(). This seems
like redundant redundancy.
Reviewed-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Tim Gardner <timg@tpi.com>
Signed-off-by: Steve French <smfrench@gmail.com>
Diffstat (limited to 'fs/cifs')
-rw-r--r-- | fs/cifs/misc.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/fs/cifs/misc.c b/fs/cifs/misc.c index 138a011633fe..298e31e3bdc6 100644 --- a/fs/cifs/misc.c +++ b/fs/cifs/misc.c @@ -278,7 +278,7 @@ header_assemble(struct smb_hdr *buffer, char smb_command /* command */ , } static int -check_smb_hdr(struct smb_hdr *smb, __u16 mid) +check_smb_hdr(struct smb_hdr *smb) { /* does it have the right SMB "signature" ? */ if (*(__le32 *) smb->Protocol != cpu_to_le32(0x424d53ff)) { @@ -287,13 +287,6 @@ check_smb_hdr(struct smb_hdr *smb, __u16 mid) return 1; } - /* Make sure that message ids match */ - if (mid != smb->Mid) { - cifs_dbg(VFS, "Mids do not match. received=%u expected=%u\n", - smb->Mid, mid); - return 1; - } - /* if it's a response then accept */ if (smb->Flags & SMBFLG_RESPONSE) return 0; @@ -310,7 +303,6 @@ int checkSMB(char *buf, unsigned int total_read) { struct smb_hdr *smb = (struct smb_hdr *)buf; - __u16 mid = smb->Mid; __u32 rfclen = be32_to_cpu(smb->smb_buf_length); __u32 clc_len; /* calculated length */ cifs_dbg(FYI, "checkSMB Length: 0x%x, smb_buf_length: 0x%x\n", @@ -348,7 +340,7 @@ checkSMB(char *buf, unsigned int total_read) } /* otherwise, there is enough to get to the BCC */ - if (check_smb_hdr(smb, mid)) + if (check_smb_hdr(smb)) return -EIO; clc_len = smbCalcSize(smb); |