aboutsummaryrefslogtreecommitdiff
path: root/hw/tpm
diff options
context:
space:
mode:
authorStefan Berger <stefanb@linux.ibm.com>2018-10-30 17:32:56 -0400
committerStefan Berger <stefanb@linux.ibm.com>2018-10-30 17:34:22 -0400
commiteff1fe9fd0cebe2293eea9597616f792b6b5ad18 (patch)
treed772c58a8c9593a41139aea3e39586155f8b6c91 /hw/tpm
parent1f63669ec925b9158095c289ef590384d3a4a591 (diff)
downloadqemu-eff1fe9fd0cebe2293eea9597616f792b6b5ad18.zip
qemu-eff1fe9fd0cebe2293eea9597616f792b6b5ad18.tar.gz
qemu-eff1fe9fd0cebe2293eea9597616f792b6b5ad18.tar.bz2
tpm: Zero-init structure to avoid uninitialized variables in valgrind log
Zero-init the ptm_loc structure so that we don't have fields that are not initialised. Signed-off-by: Stefan Berger <stefanb@linux.ibm.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Diffstat (limited to 'hw/tpm')
-rw-r--r--hw/tpm/tpm_emulator.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/hw/tpm/tpm_emulator.c b/hw/tpm/tpm_emulator.c
index 10bc20d..70f4b10 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) {