aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/misc.c
diff options
context:
space:
mode:
authorTim Gardner <timg@tpi.com>2013-10-16 11:09:49 -0400
committerSteve French <smfrench@gmail.com>2013-10-28 10:31:36 -0400
commit944d6f1a5b8f42a780a65378e5f52bea3ae0ce07 (patch)
treedbb65a46368cee19de7f885c5f470d3bb976e064 /fs/cifs/misc.c
parent34f626406c09dd45878ce75170abab342985ec24 (diff)
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/misc.c')
-rw-r--r--fs/cifs/misc.c12
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 */ ,
278} 278}
279 279
280static int 280static int
281check_smb_hdr(struct smb_hdr *smb, __u16 mid) 281check_smb_hdr(struct smb_hdr *smb)
282{ 282{
283 /* does it have the right SMB "signature" ? */ 283 /* does it have the right SMB "signature" ? */
284 if (*(__le32 *) smb->Protocol != cpu_to_le32(0x424d53ff)) { 284 if (*(__le32 *) smb->Protocol != cpu_to_le32(0x424d53ff)) {
@@ -287,13 +287,6 @@ check_smb_hdr(struct smb_hdr *smb, __u16 mid)
287 return 1; 287 return 1;
288 } 288 }
289 289
290 /* Make sure that message ids match */
291 if (mid != smb->Mid) {
292 cifs_dbg(VFS, "Mids do not match. received=%u expected=%u\n",
293 smb->Mid, mid);
294 return 1;
295 }
296
297 /* if it's a response then accept */ 290 /* if it's a response then accept */
298 if (smb->Flags & SMBFLG_RESPONSE) 291 if (smb->Flags & SMBFLG_RESPONSE)
299 return 0; 292 return 0;
@@ -310,7 +303,6 @@ int
310checkSMB(char *buf, unsigned int total_read) 303checkSMB(char *buf, unsigned int total_read)
311{ 304{
312 struct smb_hdr *smb = (struct smb_hdr *)buf; 305 struct smb_hdr *smb = (struct smb_hdr *)buf;
313 __u16 mid = smb->Mid;
314 __u32 rfclen = be32_to_cpu(smb->smb_buf_length); 306 __u32 rfclen = be32_to_cpu(smb->smb_buf_length);
315 __u32 clc_len; /* calculated length */ 307 __u32 clc_len; /* calculated length */
316 cifs_dbg(FYI, "checkSMB Length: 0x%x, smb_buf_length: 0x%x\n", 308 cifs_dbg(FYI, "checkSMB Length: 0x%x, smb_buf_length: 0x%x\n",
@@ -348,7 +340,7 @@ checkSMB(char *buf, unsigned int total_read)
348 } 340 }
349 341
350 /* otherwise, there is enough to get to the BCC */ 342 /* otherwise, there is enough to get to the BCC */
351 if (check_smb_hdr(smb, mid)) 343 if (check_smb_hdr(smb))
352 return -EIO; 344 return -EIO;
353 clc_len = smbCalcSize(smb); 345 clc_len = smbCalcSize(smb);
354 346