summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Pronin <apronin@google.com>2023-03-17 22:28:15 -0700
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-03-19 17:51:43 +0000
commit9cfcd92ad0e417d08791ec8446eb9a9524ef72a2 (patch)
tree7805273a2c6ff3f34ed8d59f19a5dc022c74fa78
parent8c2d93d80233b014078ac01e7d93ea89089b950b (diff)
downloadchrome-ec-release-R113-15393.B-cr50_stab.tar.gz
Before this fix, update_pcr was inserting an extra byte at the start of the updated value. BUG=b:273331256 TEST=see BUG Change-Id: Idb648ff7f999c48f93bd7dfe9a207ecd48fa53d5 Signed-off-by: Andrey Pronin <apronin@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4351200 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org> Commit-Queue: Andrey Pronin <apronin@chromium.org> Tested-by: Andrey Pronin <apronin@chromium.org>
-rw-r--r--common/new_nvmem.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/common/new_nvmem.c b/common/new_nvmem.c
index 8e496fe9a5..2d6a801512 100644
--- a/common/new_nvmem.c
+++ b/common/new_nvmem.c
@@ -2425,15 +2425,7 @@ static enum ec_error_list update_pcr(const struct access_tracker *at,
struct nn_container *ch, uint8_t index,
uint8_t *cached)
{
- uint8_t preserved;
-
- cached--;
- preserved = cached[0];
- cached[0] = index;
- update_object(at, ch, cached, ch->size);
- cached[0] = preserved;
-
- return EC_SUCCESS;
+ return update_object(at, ch, cached, ch->size);
}
static enum ec_error_list save_pcr(struct nn_container *ch,