* [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
* Re: [Qemu-devel] [PATCH] tpm: Zero-init structure to avoid uninitialized variables in valgrind log
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é
0 siblings, 0 replies; 2+ messages in thread
From: Philippe Mathieu-Daudé @ 2018-10-24 22:43 UTC (permalink / raw)
To: Stefan Berger, qemu-devel; +Cc: marcandre.lureau, Stefan Berger
On 24/10/18 21:14, Stefan Berger wrote:
> 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;
>
^ permalink raw reply [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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.