diff options
author | Amit Kumar Salecha <amit.salecha@qlogic.com> | 2010-04-01 15:01:35 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-04-03 17:19:16 -0400 |
commit | 22dfaa86e90235b9e5ea014be4268f457c72a63c (patch) | |
tree | c21258fff0dcc59538d0e86380c84698ef69e4db /drivers/net/qlcnic | |
parent | 34ce36268331719894c4b237a9413fe9e1ab4f75 (diff) |
qlcnic: fix endianness in fw validation
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>
Diffstat (limited to 'drivers/net/qlcnic')
-rw-r--r-- | drivers/net/qlcnic/qlcnic_init.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/net/qlcnic/qlcnic_init.c b/drivers/net/qlcnic/qlcnic_init.c index ccd24f49b6dd..89c64e8ec849 100644 --- a/drivers/net/qlcnic/qlcnic_init.c +++ b/drivers/net/qlcnic/qlcnic_init.c | |||
@@ -627,7 +627,7 @@ qlcnic_validate_bootld(struct qlcnic_adapter *adapter) | |||
627 | return -EINVAL; | 627 | return -EINVAL; |
628 | 628 | ||
629 | tab_size = cpu_to_le32(tab_desc->findex) + | 629 | tab_size = cpu_to_le32(tab_desc->findex) + |
630 | (cpu_to_le32(tab_desc->entry_size * (idx + 1))); | 630 | (cpu_to_le32(tab_desc->entry_size) * (idx + 1)); |
631 | 631 | ||
632 | if (adapter->fw->size < tab_size) | 632 | if (adapter->fw->size < tab_size) |
633 | return -EINVAL; | 633 | return -EINVAL; |
@@ -636,7 +636,7 @@ qlcnic_validate_bootld(struct qlcnic_adapter *adapter) | |||
636 | (cpu_to_le32(tab_desc->entry_size) * (idx)); | 636 | (cpu_to_le32(tab_desc->entry_size) * (idx)); |
637 | descr = (struct uni_data_desc *)&unirom[offs]; | 637 | descr = (struct uni_data_desc *)&unirom[offs]; |
638 | 638 | ||
639 | data_size = descr->findex + cpu_to_le32(descr->size); | 639 | data_size = cpu_to_le32(descr->findex) + cpu_to_le32(descr->size); |
640 | 640 | ||
641 | if (adapter->fw->size < data_size) | 641 | if (adapter->fw->size < data_size) |
642 | return -EINVAL; | 642 | return -EINVAL; |
@@ -662,7 +662,7 @@ qlcnic_validate_fw(struct qlcnic_adapter *adapter) | |||
662 | return -EINVAL; | 662 | return -EINVAL; |
663 | 663 | ||
664 | tab_size = cpu_to_le32(tab_desc->findex) + | 664 | tab_size = cpu_to_le32(tab_desc->findex) + |
665 | (cpu_to_le32(tab_desc->entry_size * (idx + 1))); | 665 | (cpu_to_le32(tab_desc->entry_size) * (idx + 1)); |
666 | 666 | ||
667 | if (adapter->fw->size < tab_size) | 667 | if (adapter->fw->size < tab_size) |
668 | return -EINVAL; | 668 | return -EINVAL; |
@@ -670,7 +670,7 @@ qlcnic_validate_fw(struct qlcnic_adapter *adapter) | |||
670 | offs = cpu_to_le32(tab_desc->findex) + | 670 | offs = cpu_to_le32(tab_desc->findex) + |
671 | (cpu_to_le32(tab_desc->entry_size) * (idx)); | 671 | (cpu_to_le32(tab_desc->entry_size) * (idx)); |
672 | descr = (struct uni_data_desc *)&unirom[offs]; | 672 | descr = (struct uni_data_desc *)&unirom[offs]; |
673 | data_size = descr->findex + cpu_to_le32(descr->size); | 673 | data_size = cpu_to_le32(descr->findex) + cpu_to_le32(descr->size); |
674 | 674 | ||
675 | if (adapter->fw->size < data_size) | 675 | if (adapter->fw->size < data_size) |
676 | return -EINVAL; | 676 | return -EINVAL; |