summaryrefslogtreecommitdiff
path: root/drivers/tpm
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2016-04-12 15:11:22 -0400
committerSimon Glass <sjg@chromium.org>2016-04-15 08:14:37 -0600
commit7e019daf7ab9dca3bf782d6de866b36d44ede95e (patch)
tree4af49ad4fc2afdb4ddc9a013476251aee443a9e0 /drivers/tpm
parent43c4d44e3330fd21679c0790fa2176075d0e69bf (diff)
downloadu-boot-imx-7e019daf7ab9dca3bf782d6de866b36d44ede95e.zip
u-boot-imx-7e019daf7ab9dca3bf782d6de866b36d44ede95e.tar.gz
u-boot-imx-7e019daf7ab9dca3bf782d6de866b36d44ede95e.tar.bz2
drivers/tpm/tpm_tis_sandbox.c: Fix uninitialized variable use
In rollback_space_kernel we were not initializing the reserved fields which should be for safety sake, and doing memset here means we don't need to set the version field specifically either. Reported-by: Coverity (CID: 143917) Cc: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'drivers/tpm')
-rw-r--r--drivers/tpm/tpm_tis_sandbox.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/tpm/tpm_tis_sandbox.c b/drivers/tpm/tpm_tis_sandbox.c
index 4aade56..e7746dc 100644
--- a/drivers/tpm/tpm_tis_sandbox.c
+++ b/drivers/tpm/tpm_tis_sandbox.c
@@ -214,9 +214,9 @@ static int sandbox_tpm_xfer(struct udevice *dev, const uint8_t *sendbuf,
data = recvbuf + TPM_RESPONSE_HEADER_LENGTH +
sizeof(uint32_t);
+ memset(&rsk, 0, sizeof(struct rollback_space_kernel));
rsk.struct_version = 2;
rsk.uid = ROLLBACK_SPACE_KERNEL_UID;
- rsk.kernel_versions = 0;
rsk.crc8 = crc8(0, (unsigned char *)&rsk,
offsetof(struct rollback_space_kernel,
crc8));