Skip to content

Commit

Permalink
firmware: Sigma: Skip header during CRC generation
Browse files Browse the repository at this point in the history
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: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@kernel.org
  • Loading branch information
Lars-Peter Clausen authored and Mark Brown committed Nov 29, 2011
1 parent 4f718a2 commit c56935b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/firmware/sigma.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit c56935b

Please sign in to comment.