Skip to content

Commit

Permalink
wimax/i2400m: verify firmware format version is known
Browse files Browse the repository at this point in the history
Make sure the bootloading code checks that the format of the file is
understood (major version match). This also fixes a dumb typo in
extracting the major version field.

Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
  • Loading branch information
Inaky Perez-Gonzalez committed Oct 19, 2009
1 parent 923d708 commit fabce1a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion drivers/net/wimax/i2400m/fw.c
Original file line number Diff line number Diff line change
Expand Up @@ -1179,7 +1179,7 @@ int i2400m_fw_check(struct i2400m *i2400m,

module_type = bcf->module_type;
header_len = sizeof(u32) * le32_to_cpu(bcf->header_len);
major_version = le32_to_cpu(bcf->header_version) & 0xffff0000 >> 16;
major_version = (le32_to_cpu(bcf->header_version) & 0xffff0000) >> 16;
minor_version = le32_to_cpu(bcf->header_version) & 0x0000ffff;
module_id = le32_to_cpu(bcf->module_id);
module_vendor = le32_to_cpu(bcf->module_vendor);
Expand All @@ -1205,6 +1205,12 @@ int i2400m_fw_check(struct i2400m *i2400m,
goto error;
}

if (major_version != 1) {
dev_err(dev, "%s: major header version v%u.%u not supported\n",
i2400m->fw_name, major_version, minor_version);
goto error;
}

/* Check soft-er errors */
result = 0;
if (module_vendor != 0x8086)
Expand Down

0 comments on commit fabce1a

Please sign in to comment.