提交 c56935bd 编写于 作者: L Lars-Peter Clausen 提交者: Mark Brown

firmware: Sigma: Skip header during CRC generation

The firmware header is not part of the CRC, so skip it. Otherwise the firmware
will be rejected due to non-matching CRCs.
Signed-off-by: NLars-Peter Clausen <lars@metafoo.de>
Acked-by: NMike Frysinger <vapier@gentoo.org>
Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@kernel.org
上级 4f718a29
......@@ -130,7 +130,8 @@ int process_sigma_firmware(struct i2c_client *client, const char *name)
if (memcmp(ssfw_head->magic, SIGMA_MAGIC, ARRAY_SIZE(ssfw_head->magic)))
goto done;
crc = crc32(0, fw->data, fw->size);
crc = crc32(0, fw->data + sizeof(*ssfw_head),
fw->size - sizeof(*ssfw_head));
pr_debug("%s: crc=%x\n", __func__, crc);
if (crc != ssfw_head->crc)
goto done;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册