提交 69ec5ee5 编写于 作者: S Stefan Berger 提交者: Michael Roth

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: NStefan Berger <stefanb@linux.ibm.com>
Reviewed-by: NPhilippe Mathieu-Daudé <philmd@redhat.com>
(cherry picked from commit eff1fe9f)
Signed-off-by: NMichael Roth <mdroth@linux.vnet.ibm.com>
上级 16d1300e
......@@ -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) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册