qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] tpm: Zero-init structure to avoid uninitialized variables in valgrind log
@ 2018-10-24 19:14 Stefan Berger
  2018-10-24 22:43 ` Philippe Mathieu-Daudé
  0 siblings, 1 reply; 2+ messages in thread
From: Stefan Berger @ 2018-10-24 19:14 UTC (permalink / raw)
  To: qemu-devel; +Cc: marcandre.lureau, Stefan Berger, Stefan Berger

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

diff --git a/hw/tpm/tpm_emulator.c b/hw/tpm/tpm_emulator.c
index 10bc20dbec..968f06ae3b 100644
--- a/hw/tpm/tpm_emulator.c
+++ b/hw/tpm/tpm_emulator.c
@@ -158,7 +158,7 @@ static int tpm_emulator_unix_tx_bufs(TPMEmulator *tpm_emu,
 static int tpm_emulator_set_locality(TPMEmulator *tpm_emu, uint8_t locty_number,
                                      Error **errp)
 {
-    ptm_loc loc;
+    ptm_loc loc = { 0 };
 
     if (tpm_emu->cur_locty_number == locty_number) {
         return 0;
-- 
2.17.1

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

end of thread, other threads:[~2018-10-24 22:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-10-24 19:14 [Qemu-devel] [PATCH] tpm: Zero-init structure to avoid uninitialized variables in valgrind log Stefan Berger
2018-10-24 22:43 ` Philippe Mathieu-Daudé

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).