]> err.no Git - linux-2.6/blobdiff - drivers/net/wireless/zd1211rw/zd_usb.c
[PATCH] zd1211rw: Fixed endianess issue with length info tag detection
[linux-2.6] / drivers / net / wireless / zd1211rw / zd_usb.c
index f9a93f6abe845b5de5438ef60f62ccf33a7974a0..6320984126c73adf63acf2cd55aee078b4f6f7da 100644 (file)
@@ -544,11 +544,11 @@ static void handle_rx_packet(struct zd_usb *usb, const u8 *buffer,
         * be padded. Unaligned access might also happen if the length_info
         * structure is not present.
         */
-       if (get_unaligned(&length_info->tag) == RX_LENGTH_INFO_TAG) {
+       if (get_unaligned(&length_info->tag) == cpu_to_le16(RX_LENGTH_INFO_TAG))
+       {
                unsigned int l, k, n;
                for (i = 0, l = 0;; i++) {
-                       k = le16_to_cpu(get_unaligned(
-                               &length_info->length[i]));
+                       k = le16_to_cpu(get_unaligned(&length_info->length[i]));
                        n = l+k;
                        if (n > length)
                                return;