From: Stefan Berger <stefanb@linux.vnet.ibm.com>
To: qemu-devel@nongnu.org
Cc: marcandre.lureau@redhat.com,
Stefan Berger <stefanb@linux.vnet.ibm.com>,
Stefan Berger <stefanb@linux.ibm.com>
Subject: [Qemu-devel] [PATCH] tpm: Zero-init structure to avoid uninitialized variables in valgrind log
Date: Wed, 24 Oct 2018 15:14:58 -0400 [thread overview]
Message-ID: <20181024191458.1277823-1-stefanb@linux.vnet.ibm.com> (raw)
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
next reply other threads:[~2018-10-24 19:15 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-24 19:14 Stefan Berger [this message]
2018-10-24 22:43 ` [Qemu-devel] [PATCH] tpm: Zero-init structure to avoid uninitialized variables in valgrind log Philippe Mathieu-Daudé
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181024191458.1277823-1-stefanb@linux.vnet.ibm.com \
--to=stefanb@linux.vnet.ibm.com \
--cc=marcandre.lureau@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanb@linux.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).