summaryrefslogtreecommitdiff
path: root/board/haboki
diff options
context:
space:
mode:
authorRobert Zieba <robertzieba@google.com>2022-04-26 11:22:06 -0600
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-05-05 17:19:43 +0000
commitab0976af3371547511fa37c9e769faa509eddd1c (patch)
treea79b45a5fc0a73e68ae77673a70da8ab384a4667 /board/haboki
parent8f7ec2f4d15b811d37dddad4f25334a41fc5f113 (diff)
downloadchrome-ec-ab0976af3371547511fa37c9e769faa509eddd1c.tar.gz
smart battery: Fix mfgacc access function reading wrong number of bytes
`sb_read_mfgacc` currently uses `sb_read_string`. This function reads a null-terminated string. However, the data that is being read is not a null-terminated string. This is causing N-1 bytes to be read instead of N bytes. This commit adds an `sb_read_sized_block` function that is used instead. Only PARAM_SAFETY_STATUS and PARAM_OPERATION_STATUS are read with `sb_read_mfgacc` and neither of these values are a string. BUG=b:228589840 TEST=Ran i2ctrace to verify that right number of bytes are now being read, tested with CL:3578293 to ensure no errors BRANCH=guybrush Change-Id: Iaedb4d28274bda8b6d1ee6d2021ebd04f83767f8 Signed-off-by: Robert Zieba <robertzieba@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3606146 Reviewed-by: Rob Barnes <robbarnes@google.com> Reviewed-by: Diana Z <dzigterman@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Diffstat (limited to 'board/haboki')
0 files changed, 0 insertions, 0 deletions