aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2011-11-28 09:44:15 +0100
committerGreg Kroah-Hartman <gregkh@suse.de>2011-12-09 08:52:39 -0800
commitcd319e4350715b72939eec5c526ab60bd02b5229 (patch)
tree327a4eb22e7bbd8726d59735860755c8e349e282
parentf18cc6ba85619dfee8ed4a9564ae8c0fcb874cbe (diff)
firmware: Sigma: Skip header during CRC generation
commit c56935bdc0a8edf50237d3b0205133a5b0adc604 upstream. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/firmware/sigma.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/firmware/sigma.c b/drivers/firmware/sigma.c
index c780baa59ed..36265de0a9e 100644
--- a/drivers/firmware/sigma.c
+++ b/drivers/firmware/sigma.c
@@ -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;