[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 1/4] tpm: Zero-init structure to avoid uninitialized
From: |
Stefan Berger |
Subject: |
[Qemu-devel] [PATCH 1/4] tpm: Zero-init structure to avoid uninitialized variables in valgrind log |
Date: |
Mon, 21 Jan 2019 12:07:28 -0500 |
Zero-init the ptm_loc structure so that we don't have fields that
are not initialised.
Signed-off-by: Stefan Berger <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
---
hw/tpm/tpm_emulator.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/hw/tpm/tpm_emulator.c b/hw/tpm/tpm_emulator.c
index 10bc20dbec..70f4b10284 100644
--- a/hw/tpm/tpm_emulator.c
+++ b/hw/tpm/tpm_emulator.c
@@ -166,6 +166,7 @@ static int tpm_emulator_set_locality(TPMEmulator *tpm_emu,
uint8_t locty_number,
trace_tpm_emulator_set_locality(locty_number);
+ memset(&loc, 0, sizeof(loc));
loc.u.req.loc = locty_number;
if (tpm_emulator_ctrlcmd(tpm_emu, CMD_SET_LOCALITY, &loc,
sizeof(loc), sizeof(loc)) < 0) {
--
2.17.2
- [Qemu-devel] [PATCH 0/4] TPM patches for stable-3.0.0 (v3.0.1), Stefan Berger, 2019/01/21
- [Qemu-devel] [PATCH 4/4] tpm: Make sure the locality received from backend is valid, Stefan Berger, 2019/01/21
- [Qemu-devel] [PATCH 3/4] tpm: Make sure new locality passed to tpm_tis_prep_abort() is valid, Stefan Berger, 2019/01/21
- [Qemu-devel] [PATCH 2/4] tpm: use loop iterator to set sts data field, Stefan Berger, 2019/01/21
- [Qemu-devel] [PATCH 1/4] tpm: Zero-init structure to avoid uninitialized variables in valgrind log,
Stefan Berger <=
- Re: [Qemu-devel] [PATCH 0/4] TPM patches for stable-3.0.0 (v3.0.1), no-reply, 2019/01/31
- Re: [Qemu-devel] [PATCH 0/4] TPM patches for stable-3.0.0 (v3.0.1), no-reply, 2019/01/31
- Re: [Qemu-devel] [PATCH 0/4] TPM patches for stable-3.0.0 (v3.0.1), no-reply, 2019/01/31
- Re: [Qemu-devel] [PATCH 0/4] TPM patches for stable-3.0.0 (v3.0.1), no-reply, 2019/01/31
- Re: [Qemu-devel] [PATCH 0/4] TPM patches for stable-3.0.0 (v3.0.1), no-reply, 2019/01/31