qlcnic: fix endianness in fw validation
authorAmit Kumar Salecha <amit.salecha@qlogic.com>
Thu, 1 Apr 2010 19:01:35 +0000 (19:01 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sat, 3 Apr 2010 21:19:16 +0000 (14:19 -0700)
cpu_to_le32 was missing and used improperly.

Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/qlcnic/qlcnic_init.c

index ccd24f49b6dde476e353a4ea6ff71c9c0da977b8..89c64e8ec8498de68f6b4481364b48a82f07e09a 100644 (file)
@@ -627,7 +627,7 @@ qlcnic_validate_bootld(struct qlcnic_adapter *adapter)
                return -EINVAL;
 
        tab_size = cpu_to_le32(tab_desc->findex) +
-                       (cpu_to_le32(tab_desc->entry_size * (idx + 1)));
+                       (cpu_to_le32(tab_desc->entry_size) * (idx + 1));
 
        if (adapter->fw->size < tab_size)
                return -EINVAL;
@@ -636,7 +636,7 @@ qlcnic_validate_bootld(struct qlcnic_adapter *adapter)
                (cpu_to_le32(tab_desc->entry_size) * (idx));
        descr = (struct uni_data_desc *)&unirom[offs];
 
-       data_size = descr->findex + cpu_to_le32(descr->size);
+       data_size = cpu_to_le32(descr->findex) + cpu_to_le32(descr->size);
 
        if (adapter->fw->size < data_size)
                return -EINVAL;
@@ -662,7 +662,7 @@ qlcnic_validate_fw(struct qlcnic_adapter *adapter)
                return -EINVAL;
 
        tab_size = cpu_to_le32(tab_desc->findex) +
-                       (cpu_to_le32(tab_desc->entry_size * (idx + 1)));
+                       (cpu_to_le32(tab_desc->entry_size) * (idx + 1));
 
        if (adapter->fw->size < tab_size)
                return -EINVAL;
@@ -670,7 +670,7 @@ qlcnic_validate_fw(struct qlcnic_adapter *adapter)
        offs = cpu_to_le32(tab_desc->findex) +
                (cpu_to_le32(tab_desc->entry_size) * (idx));
        descr = (struct uni_data_desc *)&unirom[offs];
-       data_size = descr->findex + cpu_to_le32(descr->size);
+       data_size = cpu_to_le32(descr->findex) + cpu_to_le32(descr->size);
 
        if (adapter->fw->size < data_size)
                return -EINVAL;