summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/dev/cxgbe/common/t4_hw.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/dev/cxgbe/common/t4_hw.c b/sys/dev/cxgbe/common/t4_hw.c
index 50e2490..965e1fe 100644
--- a/sys/dev/cxgbe/common/t4_hw.c
+++ b/sys/dev/cxgbe/common/t4_hw.c
@@ -1136,6 +1136,13 @@ int t4_load_fw(struct adapter *adap, const u8 *fw_data, unsigned int size)
FLASH_FW_MAX_SIZE);
return -EFBIG;
}
+ if ((is_t4(adap) && hdr->chip != FW_HDR_CHIP_T4) ||
+ (is_t5(adap) && hdr->chip != FW_HDR_CHIP_T5)) {
+ CH_ERR(adap,
+ "FW image (%d) is not suitable for this adapter (%d)\n",
+ hdr->chip, chip_id(adap));
+ return -EINVAL;
+ }
for (csum = 0, i = 0; i < size / sizeof(csum); i++)
csum += ntohl(p[i]);
OpenPOWER on IntegriCloud