From: Stefan Berger <stefanb@linux.vnet.ibm.com>
To: qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org, Stefan Berger <stefanb@linux.ibm.com>
Subject: [Qemu-devel] [PULL v2 5/5] tpm: Zero-init structure to avoid uninitialized variables in valgrind log
Date: Tue, 30 Oct 2018 17:47:40 -0400 [thread overview]
Message-ID: <20181030214740.2294043-6-stefanb@linux.vnet.ibm.com> (raw)
In-Reply-To: <20181030214740.2294043-1-stefanb@linux.vnet.ibm.com>
From: Stefan Berger <stefanb@linux.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 | 1 +
1 file changed, 1 insertion(+)
diff --git a/hw/tpm/tpm_emulator.c b/hw/tpm/tpm_emulator.c
index 10bc20dbec..70f4b10284 100644
--- 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) {
--
2.17.1
next prev parent reply other threads:[~2018-10-30 22:19 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-30 21:47 [Qemu-devel] [PULL v2 0/5] Merge tpm 2018/10/29 v2 Stefan Berger
2018-10-30 21:47 ` [Qemu-devel] [PULL v2 1/5] tests/tpm: fix tpm_util_swtpm_has_tpm2() Stefan Berger
2018-10-30 21:47 ` [Qemu-devel] [PULL v2 2/5] tests/tpm: Display if swtpm is not found or --tpm2 not supported Stefan Berger
2018-11-06 11:51 ` Thomas Huth
2018-11-06 14:35 ` Stefan Berger
2018-10-30 21:47 ` [Qemu-devel] [PULL v2 3/5] docs: tpm: Mention implemented TPM CRB interface emulation and specs Stefan Berger
2018-10-30 21:47 ` [Qemu-devel] [PULL v2 4/5] MAINTAINERS: Change my email address to the new domain Stefan Berger
2018-10-30 21:47 ` Stefan Berger [this message]
2018-11-01 13:24 ` [Qemu-devel] [PULL v2 0/5] Merge tpm 2018/10/29 v2 Peter Maydell
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=20181030214740.2294043-6-stefanb@linux.vnet.ibm.com \
--to=stefanb@linux.vnet.ibm.com \
--cc=peter.maydell@linaro.org \
--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).