diff options
Diffstat (limited to 'drivers/net/benet/be_main.c')
-rw-r--r-- | drivers/net/benet/be_main.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c index a08faf3c8e1c..b0faaa204c7c 100644 --- a/drivers/net/benet/be_main.c +++ b/drivers/net/benet/be_main.c | |||
@@ -1991,7 +1991,7 @@ int be_load_fw(struct be_adapter *adapter, u8 *func) | |||
1991 | struct flash_file_hdr_g3 *fhdr3; | 1991 | struct flash_file_hdr_g3 *fhdr3; |
1992 | struct image_hdr *img_hdr_ptr = NULL; | 1992 | struct image_hdr *img_hdr_ptr = NULL; |
1993 | struct be_dma_mem flash_cmd; | 1993 | struct be_dma_mem flash_cmd; |
1994 | int status, i = 0; | 1994 | int status, i = 0, num_imgs = 0; |
1995 | const u8 *p; | 1995 | const u8 *p; |
1996 | 1996 | ||
1997 | strcpy(fw_file, func); | 1997 | strcpy(fw_file, func); |
@@ -2017,15 +2017,14 @@ int be_load_fw(struct be_adapter *adapter, u8 *func) | |||
2017 | if ((adapter->generation == BE_GEN3) && | 2017 | if ((adapter->generation == BE_GEN3) && |
2018 | (get_ufigen_type(fhdr) == BE_GEN3)) { | 2018 | (get_ufigen_type(fhdr) == BE_GEN3)) { |
2019 | fhdr3 = (struct flash_file_hdr_g3 *) fw->data; | 2019 | fhdr3 = (struct flash_file_hdr_g3 *) fw->data; |
2020 | for (i = 0; i < fhdr3->num_imgs; i++) { | 2020 | num_imgs = le32_to_cpu(fhdr3->num_imgs); |
2021 | for (i = 0; i < num_imgs; i++) { | ||
2021 | img_hdr_ptr = (struct image_hdr *) (fw->data + | 2022 | img_hdr_ptr = (struct image_hdr *) (fw->data + |
2022 | (sizeof(struct flash_file_hdr_g3) + | 2023 | (sizeof(struct flash_file_hdr_g3) + |
2023 | i * sizeof(struct image_hdr))); | 2024 | i * sizeof(struct image_hdr))); |
2024 | if (img_hdr_ptr->imageid == 1) { | 2025 | if (le32_to_cpu(img_hdr_ptr->imageid) == 1) |
2025 | status = be_flash_data(adapter, fw, | 2026 | status = be_flash_data(adapter, fw, &flash_cmd, |
2026 | &flash_cmd, fhdr3->num_imgs); | 2027 | num_imgs); |
2027 | } | ||
2028 | |||
2029 | } | 2028 | } |
2030 | } else if ((adapter->generation == BE_GEN2) && | 2029 | } else if ((adapter->generation == BE_GEN2) && |
2031 | (get_ufigen_type(fhdr) == BE_GEN2)) { | 2030 | (get_ufigen_type(fhdr) == BE_GEN2)) { |