projects
/
qemu.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1f63669
)
tpm: Zero-init structure to avoid uninitialized variables in valgrind log
author
Stefan Berger
<stefanb@linux.ibm.com>
Tue, 30 Oct 2018 21:32:56 +0000
(17:32 -0400)
committer
Stefan Berger
<stefanb@linux.ibm.com>
Tue, 30 Oct 2018 21:34:22 +0000
(17:34 -0400)
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>
hw/tpm/tpm_emulator.c
patch
|
blob
|
history
diff --git
a/hw/tpm/tpm_emulator.c
b/hw/tpm/tpm_emulator.c
index 10bc20dbec4061d93090edd9e2cd07719a9f9080..70f4b10284f051624ded9eeb570677b85c550fa3 100644
(file)
--- 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) {