summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMary Ruthven <mruthven@chromium.org>2019-04-10 15:26:07 -0700
committerchrome-bot <chrome-bot@chromium.org>2019-04-15 17:51:44 -0700
commitb166142439f81abaf08a8a62a1d3c04e5f7ab78e (patch)
tree4cf4dac04add3f54f3f492a0330ae22d9f84f079
parentc04a0865f98191c16c9254034f48bd9c46f483d2 (diff)
downloadchrome-ec-b166142439f81abaf08a8a62a1d3c04e5f7ab78e.tar.gz
g: upgrade_fw: check board id if CR50_RELAXED isn't defined
CL:1529834 mistakenly changed an ifndef to a ifdef. If CR50_RELAXED is defined, contents_allowed should always return True. In a normal image contents_allowed should check the board id before an update. This change changes the ifdef back to ifndef which is what it should be. BUG=none BRANCH=cr50 TEST=create dbg image and try to flash an image with a mismatched board id. Make sure it runs ok. Build a non dbg image and make sure mismatched board id images are rejected. Change-Id: I1dcef5a6af4edbb431fe894ca37df5dc4e1b852e Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1561972 Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Reviewed-by: Namyoon Woo <namyoon@chromium.org>
-rw-r--r--chip/g/upgrade_fw.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/chip/g/upgrade_fw.c b/chip/g/upgrade_fw.c
index 9138e6b498..eba5868c3d 100644
--- a/chip/g/upgrade_fw.c
+++ b/chip/g/upgrade_fw.c
@@ -318,7 +318,7 @@ static int contents_allowed(uint32_t block_offset,
size_t body_size, void *upgrade_data,
uint8_t *error_code)
{
-#ifdef CR50_RELAXED
+#ifndef CR50_RELAXED
#ifdef CONFIG_BOARD_ID_SUPPORT
if (block_offset == valid_sections.rw_base_offset) {
/* This block is a rw header of the new image. */