Commit 7e019daf authored by Tom Rini's avatar Tom Rini Committed by Simon Glass
Browse files

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: default avatarTom Rini <trini@konsulko.com>
parent 43c4d44e
......@@ -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));
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment