wimax/i2400m: fix missing endian correction read in fw loader
authorInaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
Fri, 11 Jun 2010 18:51:20 +0000 (11:51 -0700)
committerInaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
Fri, 11 Jun 2010 18:51:20 +0000 (11:51 -0700)
i2400m_fw_hdr_check() was accessing hardware field
bcf_hdr->module_type (little endian 32) without converting to host
byte sex.

Reported-by: Данилин Михаил <mdanilin@nsg.net.ru>
Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
drivers/net/wimax/i2400m/fw.c

index 3f283bff0ff7146447419ea714ef7cdd78884b12..11491354e5b5bf3de80d0b91ee13d7a203a0e914 100644 (file)
@@ -1192,7 +1192,7 @@ int i2400m_fw_hdr_check(struct i2400m *i2400m,
        unsigned module_type, header_len, major_version, minor_version,
                module_id, module_vendor, date, size;
 
-       module_type = bcf_hdr->module_type;
+       module_type = le32_to_cpu(bcf_hdr->module_type);
        header_len = sizeof(u32) * le32_to_cpu(bcf_hdr->header_len);
        major_version = (le32_to_cpu(bcf_hdr->header_version) & 0xffff0000)
                >> 16;