cifs: fix broken BCC check in is_valid_oplock_break
authorJeff Layton <jlayton@redhat.com>
Wed, 16 Mar 2011 19:15:30 +0000 (15:15 -0400)
committerSteve French <sfrench@us.ibm.com>
Tue, 12 Apr 2011 00:54:30 +0000 (00:54 +0000)
The BCC is still __le16 at this point, and in any case we need to
use the get_bcc_le macro to make sure we don't hit alignment
problems.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
fs/cifs/misc.c

index 7228179ef5b009be2259d14a5e3808070448b7f2..0c684ae4c07163140f4d9009b2d2ccd1f0c86dd2 100644 (file)
@@ -521,7 +521,7 @@ is_valid_oplock_break(struct smb_hdr *buf, struct TCP_Server_Info *srv)
                        (struct smb_com_transaction_change_notify_rsp *)buf;
                struct file_notify_information *pnotify;
                __u32 data_offset = 0;
-               if (pSMBr->ByteCount > sizeof(struct file_notify_information)) {
+               if (get_bcc_le(buf) > sizeof(struct file_notify_information)) {
                        data_offset = le32_to_cpu(pSMBr->DataOffset);
 
                        pnotify = (struct file_notify_information *)