Convert MessageID in smb2_hdr to LE
[firefly-linux-kernel-4.4.55.git] / fs / cifs / smb2ops.c
index 568f323665c884bcae6382c560c4efb08295f425..96b5d40a2ece611b27ed19668cc4b7b665605113 100644 (file)
@@ -176,10 +176,11 @@ smb2_find_mid(struct TCP_Server_Info *server, char *buf)
 {
        struct mid_q_entry *mid;
        struct smb2_hdr *hdr = (struct smb2_hdr *)buf;
+       __u64 wire_mid = le64_to_cpu(hdr->MessageId);
 
        spin_lock(&GlobalMid_Lock);
        list_for_each_entry(mid, &server->pending_mid_q, qhead) {
-               if ((mid->mid == hdr->MessageId) &&
+               if ((mid->mid == wire_mid) &&
                    (mid->mid_state == MID_REQUEST_SUBMITTED) &&
                    (mid->command == hdr->Command)) {
                        spin_unlock(&GlobalMid_Lock);
@@ -600,7 +601,7 @@ smb2_clone_range(const unsigned int xid,
                goto cchunk_out;
 
        /* For now array only one chunk long, will make more flexible later */
-       pcchunk->ChunkCount = __constant_cpu_to_le32(1);
+       pcchunk->ChunkCount = cpu_to_le32(1);
        pcchunk->Reserved = 0;
        pcchunk->Reserved2 = 0;