From: Stefan Berger <stefanb@linux.ibm.com>
To: qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org,
Stefan Berger <stefanb@linux.vnet.ibm.com>,
Stefan Berger <stefanb@linux.ibm.com>
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 [thread overview]
Message-ID: <20181029151956.2164336-6-stefanb@linux.ibm.com> (raw)
In-Reply-To: <20181029151956.2164336-1-stefanb@linux.ibm.com>
From: Stefan Berger <stefanb@linux.vnet.ibm.com>
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 | 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 prev parent reply other threads:[~2018-10-29 15:20 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-29 15:19 [Qemu-devel] [PULL v1 0/5] Merge tpm 2018/10/29 v1 Stefan Berger
2018-10-29 15:19 ` [Qemu-devel] [PULL v1 1/5] tests/tpm: fix tpm_util_swtpm_has_tpm2() Stefan Berger
2018-10-29 15:19 ` [Qemu-devel] [PULL v1 2/5] tests/tpm: mark swtpm test as skipped instead of successful Stefan Berger
2018-10-29 15:19 ` [Qemu-devel] [PULL v1 3/5] docs: tpm: Mention implemented TPM CRB interface emulation and specs Stefan Berger
2018-10-29 15:19 ` [Qemu-devel] [PULL v1 4/5] MAINTAINERS: Change my email address to the new domain Stefan Berger
2018-10-29 15:19 ` Stefan Berger [this message]
2018-10-30 10:44 ` [Qemu-devel] [PULL v1 0/5] Merge tpm 2018/10/29 v1 Peter Maydell
2018-10-30 11:14 ` Marc-André Lureau
2018-10-30 11:26 ` Peter Maydell
2018-10-30 12:49 ` Stefan Berger
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=20181029151956.2164336-6-stefanb@linux.ibm.com \
--to=stefanb@linux.ibm.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanb@linux.vnet.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).