qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PULL v1 5/5] tpm: Zero-init structure to avoid uninitializ


From: Stefan Berger
Subject: [Qemu-devel] [PULL v1 5/5] tpm: Zero-init structure to avoid uninitialized variables in valgrind log
Date: Mon, 29 Oct 2018 11:19:56 -0400

From: Stefan Berger <address@hidden>

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 | 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]