Commit 22dfaa86 authored by Amit Kumar Salecha's avatar Amit Kumar Salecha Committed by David S. Miller

qlcnic: fix endianness in fw validation

cpu_to_le32 was missing and used improperly.
Signed-off-by: default avatarAmit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 34ce3626
...@@ -627,7 +627,7 @@ qlcnic_validate_bootld(struct qlcnic_adapter *adapter) ...@@ -627,7 +627,7 @@ qlcnic_validate_bootld(struct qlcnic_adapter *adapter)
return -EINVAL; return -EINVAL;
tab_size = cpu_to_le32(tab_desc->findex) + 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) if (adapter->fw->size < tab_size)
return -EINVAL; return -EINVAL;
...@@ -636,7 +636,7 @@ qlcnic_validate_bootld(struct qlcnic_adapter *adapter) ...@@ -636,7 +636,7 @@ qlcnic_validate_bootld(struct qlcnic_adapter *adapter)
(cpu_to_le32(tab_desc->entry_size) * (idx)); (cpu_to_le32(tab_desc->entry_size) * (idx));
descr = (struct uni_data_desc *)&unirom[offs]; 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) if (adapter->fw->size < data_size)
return -EINVAL; return -EINVAL;
...@@ -662,7 +662,7 @@ qlcnic_validate_fw(struct qlcnic_adapter *adapter) ...@@ -662,7 +662,7 @@ qlcnic_validate_fw(struct qlcnic_adapter *adapter)
return -EINVAL; return -EINVAL;
tab_size = cpu_to_le32(tab_desc->findex) + 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) if (adapter->fw->size < tab_size)
return -EINVAL; return -EINVAL;
...@@ -670,7 +670,7 @@ qlcnic_validate_fw(struct qlcnic_adapter *adapter) ...@@ -670,7 +670,7 @@ qlcnic_validate_fw(struct qlcnic_adapter *adapter)
offs = cpu_to_le32(tab_desc->findex) + offs = cpu_to_le32(tab_desc->findex) +
(cpu_to_le32(tab_desc->entry_size) * (idx)); (cpu_to_le32(tab_desc->entry_size) * (idx));
descr = (struct uni_data_desc *)&unirom[offs]; 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) if (adapter->fw->size < data_size)
return -EINVAL; return -EINVAL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment