public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/3] drivers/tpm/tpm_tis_sandbox.c: Fix uninitialized variable use
@ 2016-04-12 19:11 Tom Rini
  2016-04-12 19:11 ` [U-Boot] [PATCH 2/3] drivers/gpio/pm8916_gpio.c: Make pid be uint32_t Tom Rini
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Tom Rini @ 2016-04-12 19:11 UTC (permalink / raw)
  To: u-boot

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>
---
 drivers/tpm/tpm_tis_sandbox.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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));
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2016-04-22 14:12 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-12 19:11 [U-Boot] [PATCH 1/3] drivers/tpm/tpm_tis_sandbox.c: Fix uninitialized variable use Tom Rini
2016-04-12 19:11 ` [U-Boot] [PATCH 2/3] drivers/gpio/pm8916_gpio.c: Make pid be uint32_t Tom Rini
2016-04-18 20:23   ` Mateusz Kulikowski
2016-04-18 20:24     ` Mateusz Kulikowski
2016-04-20 21:26       ` Tom Rini
2016-04-20 21:25     ` Tom Rini
2016-04-22 14:12       ` Mateusz Kulikowski
2016-04-21 11:23   ` [U-Boot] [U-Boot, " Tom Rini
2016-04-12 19:11 ` [U-Boot] [PATCH 3/3] drivers/power/pmic/pm8916.c: Make usid " Tom Rini
2016-04-21 11:23   ` [U-Boot] [U-Boot, " Tom Rini
2016-04-15 14:12 ` [U-Boot] [PATCH 1/3] drivers/tpm/tpm_tis_sandbox.c: Fix uninitialized variable use Simon Glass
2016-04-15 15:44   ` Simon Glass

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox