tpm: Zero-init structure to avoid uninitialized variables in valgrind log

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>
stable-3.1
Stefan Berger 2018-10-30 17:32:56 -04:00
parent 1f63669ec9
commit eff1fe9fd0
1 changed files with 1 additions and 0 deletions

View File

@ -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) {