Skip to content

Commit

Permalink
qlcnic: fix endianness in fw validation
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Amit Kumar Salecha authored and David S. Miller committed Apr 3, 2010
1 parent 34ce362 commit 22dfaa8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/net/qlcnic/qlcnic_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -662,15 +662,15 @@ 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;

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;
Expand Down

0 comments on commit 22dfaa8

Please sign in to comment.